SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
Basic Python Programming
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. reads just one line of a text file & keeps track of where in the file you're at
str
round()
+
file.readline()
2. Prevents a runtime error from stopping the program.
==
a//b
except
truncate
3. prints its parameter to the console
truncate
print()
file.write(stuff)
-=
4. Prints a string to the screen which is converted using repr()
not in
del
*=
%r
5. Function to read the contents of a file
readline
<<
read
continue
6. Symbol to subtract things from each other
-
close
#
a//b
7. exponentiation
*read
a**b
()
%s
8. square root
:
*=
math.sqrt(a)
int()
9. asks the user for a response and returns that response
input()
~
round()
elif (Else if)
10. absolute value
abs(a)
print
~
=
11. modulus AND assignment operator
print
**=
int
%=
12. subtract AND assignment operator
readline
-=
<=
readline
13. sets the file's current position
>>
append()
file.seek()
%r
14. Modulus operator. It's the remainder after division
%
read
%d
a**b
15. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.
==
insert()
not in
close
16. End header line.
input()
:
>=
&
17. The keyword beginning a header that will create a new function.
append()
def
=
n
18. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
~
|
*=
&
19. A keyword that does nothing but fill space to indicate code which will be written later.
pass
/=
+=
+=
20. floor division
**=
round()
%s
a//b
21. The extension for Python scripts
.py
append()
a//b
*read
22. divide AND assignment operator
<
/=
#
truncate
23. The keyword beginning a header that will create a new function.
def
n
append()
truncate
24. turns an object into an integer
int()
for
print()
:
25. Adds a new line character
=
>=
str
n
26. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
*read
a%b
/
Variables
27. This keyword begins a header for a body that repeats until the condition is no longer true.
print
while
pass
%d
28. rounds a number to the number of decimal points you choose
round()
*read
while
not in
29. single line comment
#
argv
else
input()
30. inserts an item inside a list at a certain index
insert()
read
|
readline
31. add AND assignment operator
+=
write
not in
or
32. Prints a string to the screen which is a signed decimal.
%d
print
<=
file.truncate()
33. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001
len()
>>
>
^
34. exponent AND assignment operator
**=
print
is not
insert()
35. returns the length of a string (number of characters)
len()
file.truncate()
int()
else
36. Create a variable.
=
a//b
if
if
37. adds an item to a list
append()
**=
pass
str()
38. Symbol to divide by the number to the right of the symbol
append()
/
-=
input()
39. Prints a string to the screen which will be Unicode.
abs(a)
float
%s
*write(stuff)
40. deletes an item from a list
len()
floating point number
del
Variables
41. add AND assignment operator
if
str
+=
raise
42. floor division AND assignment operator
**=
:
//=
:
43. unction to read one line of a file
readline
argv
**=
file.readline()
44. A built-in function that converts integers and strings to floating-point numbers.
=
:
append()
float
45. deletes an item from a list
del
=
()
abs(a)
46. Reads the contents of the file you can assign the result to a variable.
<
read
*read
47. Function to empty the contents of a file - no recovery is possible
-=
floating point number
def
truncate
48. Adds a new line character
n
/=
-
append()
49. Greater than symbol
>
-
return
append()
50. A statement that ends the current iteration of a loop but continues looping.
abs(a)
#
continue
in