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. The keyword beginning a header that will create a new function.
truncate
insert()
in
def
2. A keyword that does nothing but fill space to indicate code which will be written later.
pass
print()
raise
a**b
3. adds an item to a list
def
append()
&
%=
4. Symbol to divide by the number to the right of the symbol
print
&
if
/
5. floor division
del
round()
a//b
*=
6. Modulus operator. It's the remainder after division
%
class
~
7. Less than symbol
write
float
>
<
8. modulus AND assignment operator
else
%=
file.seek()
=
9. Reads the contents of the file you can assign the result to a variable.
print
*read
print
not in
10. single line comment
#
insert()
~
read
11. A logical operator which compares two operands and produces True if they are equal and False otherwise
truncate
read
==
not in
12. 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
not
>
^
if
13. exponentiation
==
elif (Else if)
a**b
input()
14. This keyword begins a header for a body that repeats until the condition is no longer true.
len()
while
//=
*
15. turns an object into a string
write
elif (Else if)
#
str()
16. deletes an item from a list
*read
print
del
*=
17. This keyword in the body of a conditional - gives an alternative execution.
in
argv
else
try
18. A statement that breaks out of a loop.
file.readline()
len()
insert()
break
19. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
append()
Variables
input()
open()
20. Writes stuff to the file.
elif (Else if)
file.seek()
*write(stuff)
del
21. 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
#
>>
truncate
append()
22. Adds something to a variable
+=
%=
=
pass
23. Symbol used to create comments
not
del
#
argument variable
24. inserts an item inside a list at a certain index
write
round()
n
insert()
25. Symbol to subtract things from each other
or
*
-
open()
26. subtract AND assignment operator
print
>=
-=
Variables
27. A statement that displays a value on the screen.
str()
file.seek()
print
%r
28. Greater than symbol
input()
*=
>
else
29. sets the file's current position
//=
len()
#
file.seek()
30. Adds a new line character
+
file.readline()
//=
n
31. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
*readline
file.write(stuff)
=
~
32. adds an item to a list
-
**=
append()
<
33. exponent AND assignment operator
>
if
**=
()
34. Create a variable.
is not
**=
print
=
35. Function to close a file - it will not be able to be used again unless the file is opened.
/=
close
truncate
()
36. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
+=
<
#
37. This keyword in the body of a conditional allows chained conditionals.
==
:
elif (Else if)
math.sqrt(a)
38. Function to read the contents of a file
*
#
/=
read
39. returns the length of a string (number of characters)
len()
round()
write
del
40. Argument variable
argument variable
*=
argv
<=
41. add AND assignment operator
+=
print
+
%
42. prints its parameter to the console
float
abs(a)
print()
**=
43. Modulus operator. It's the remainder after division
=
-
%
%r
44. turns an object into a string
~
str()
*write(stuff)
|
45. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
else
int
readline
.py
46. This keyword in the body of a conditional - gives an alternative execution.
%r
else
%d
*
47. rounds a number to the number of decimal points you choose
math.sqrt(a)
append()
~
round()
48. Function to write something to a file
readline
print()
-=
write
49. inserts an item inside a list at a certain index
/
is
insert()
truncate
50. unction to read one line of a file
try
=
int
readline