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 the contents of the file you can assign the result to a variable.
*read
Variables
for
close
2. Command to print to the screen
print
>>
float
+=
3. Greater than or equal symbol.
while
open()
:
>=
4. Prints a string to the screen which is converted using repr()
write
%r
:
+=
5. Prints a string to the screen which is converted using repr()
in
()
%r
=
6. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000
<<
def
not in
print()
7. 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
^
input()
%r
a//b
8. prints its parameter to the console
print()
append()
*readline
#
9. add AND assignment operator
argv
/=
input()
+=
10. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
assignment
Variables
>=
%s
11. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
raise
math.sqrt(a)
&
round()
12. divide AND assignment operator
+=
math.sqrt(a)
<=
/=
13. Function to empty the contents of a file - no recovery is possible
%
n
truncate
//=
14. Symbol to multiply things
+=
#
math.sqrt(a)
*
15. An operator that removes a value from a list.
%r
and
//=
del
16. assignment operator
<<
=
or
raise
17. Prints a string to the screen which will be Unicode.
and
%s
pass
append()
18. This keyword begins the simplest form of a conditional statement.
input()
<
if
else
19. Symbol to add things together
open()
if
+
>>
20. Function to close a file - it will not be able to be used again unless the file is opened.
close
def
%
int()
21. sets the file's current position
insert()
==
pass
file.seek()
22. Symbol to add things together
else
//=
+
close
23. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
floating point number
else
n
24. 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.
>=
break
in
continue
25. Symbol to divide by the number to the right of the symbol
/
//=
=
read
26. 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.
%=
format string
<<
argument variable
27. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
write
>=
//=
28. This keyword in the body of a conditional - gives an alternative execution.
print()
/
else
if
29. 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
+
%=
/=
>>
30. This keyword begins a header for a body that repeats until the condition is no longer true.
or
*truncate
while
>=
31. multiply AND assignment operator
+=
if
>>
*=
32. The extension for Python scripts
*readline
.py
argv
insert()
33. A built-in function that converts its argument to a string.
<<
str
=
in
34. A statement that ends the current iteration of a loop but continues looping.
<<
continue
len()
str()
35. Adds a new line character
n
elif (Else if)
/=
close
36. Prints a string to the screen which is a signed decimal.
%s
%d
+=
+
37. This keyword begins the simplest form of a conditional statement.
if
for
Variables
print()
38. Writes stuff to the file.
*write(stuff)
not
str
del
39. Adds something to a variable
:
def
argument variable
=
40. inserts an item inside a list at a certain index
in
insert()
Variables
is
41. Function to open or read a file
assignment
+
*=
open()
42. A logical operator which compares two operands and produces True if they are equal and False otherwise
^
-
==
elif (Else if)
43. A logical operator which returns a value of True if either of the conditions is true.
insert()
write
or
try
44. This keyword in the body of a conditional allows chained conditionals.
float
elif (Else if)
%s
=
45. floor division AND assignment operator
*read
int
//=
else
46. Symbol used to create comments
&
%s
#
<
47. End header line.
and
abs(a)
:
a**b
48. assignment operator
=
open()
abs(a)
:
49. subtract AND assignment operator
and
-=
argv
float
50. deletes an item from a list
print
~
/
del