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. Function to empty the contents of a file - no recovery is possible
truncate
try
append()
-=
2. Create a variable.
=
str()
and
Variables
3. exponent AND assignment operator
**=
a%b
print
#
4. Empties the file - watch out if you care about the file.
str
raise
*truncate
not
5. assignment operator
%s
**=
assignment
=
6. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
*
in
&
7. Greater than or equal symbol.
|
>=
==
a**b
8. empties the file
file.truncate()
close
argv
Variables
9. Less than or equal to symbol
readline
<=
assignment
def
10. Symbol used to create comments
pass
#
readline
*
11. Function to write something to a file
def
return
file.readline()
write
12. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
^
not
else
Variables
13. Greater than symbol
>
for
/
del
14. Symbol to add things together
+
-=
a%b
truncate
15. absolute value
*write(stuff)
abs(a)
float
def
16. Function to read the contents of a file
input()
n
read
str()
17. End header line.
*=
**=
Variables
:
18. Less than symbol
-
insert()
<
assignment
19. Less than or equal to symbol
str()
open()
<=
a//b
20. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
and
floating point number
&
=
21. rounds a number to the number of decimal points you choose
round()
open()
^
print()
22. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
read
int
>>
continue
23. unction to read one line of a file
readline
in
a%b
*
24. A built-in function that converts its argument to a string.
/=
a//b
str
25. adds an item to a list
append()
=
.py
%d
26. Adds a new line character
n
del
<<
*
27. floor division
a//b
print
-=
-=
28. writes stuff to the file
file.write(stuff)
.py
:
==
29. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
readline
%s
in
int
30. End header line.
=
:
+=
argv
31. Symbol used to create comments
&
#
del
a**b
32. prints its parameter to the console
truncate
*
print()
del
33. add AND assignment operator
<=
+=
<<
34. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111
is not
#
>>
truncate
35. This statement causes an exception.
not
%=
raise
*write(stuff)
36. A statement that displays a value on the screen.
print
if
argv
/=
37. Prints a string to the screen which is a signed decimal.
close
^
try
%d
38. Symbol to multiply things
write
**=
*read
*
39. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.
>=
in
%r
print
40. Symbol to subtract things from each other
for
-
else
=
41. floor division AND assignment operator
*
<<
try
//=
42. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
%=
*read
&
%d
43. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.
argument variable
n
try
str()
44. Command to print to the screen
<<
class
elif (Else if)
print
45. This keyword begins a header for a body that repeats until the condition is no longer true.
else
while
a//b
floating point number
46. This keyword in the body of a conditional - gives an alternative execution.
%r
else
.py
|
47. assignment operator
=
*truncate
assignment
if
48. A keyword that does nothing but fill space to indicate code which will be written later.
=
is not
file.seek()
pass
49. This keyword begins the simplest form of a conditional statement.
*
<<
*
if
50. Prints a string to the screen which is converted using repr()
open()
round()
%r
()