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 extension for Python scripts
.py
in
len()
%d
2. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
pass
truncate
|
print
3. rounds a number to the number of decimal points you choose
file.write(stuff)
round()
>>
//=
4. exponent AND assignment operator
round()
if
str()
**=
5. sets the file's current position
file.seek()
==
#
for
6. prints its parameter to the console
else
or
%s
print()
7. This keyword begins a header for a body that repeats until the condition is no longer true.
=
while
print
argv
8. deletes an item from a list
+=
abs(a)
.py
del
9. 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
<<
%d
read
print
10. Function to read the contents of a file
or
read
floating point number
=
11. single line comment
#
+=
open()
except
12. Less than symbol
write
#
a%b
<
13. A built-in function that converts its argument to a string.
#
str
return
close
14. Function to write something to a file
*=
write
close
file.readline()
15. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
>>
>
in
int()
16. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
=
while
~
17. Adds a new line character
#
n
>>
else
18. 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
**=
close
>>
19. Symbol to subtract things from each other
<
-
<
abs(a)
20. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
a%b
**=
try
else
21. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
if
=
del
22. inserts an item inside a list at a certain index
a%b
*=
else
insert()
23. floor division
=
for
a//b
.py
24. assignment operator
==
=
readline
*readline
25. Command to print to the screen
argv
or
print
float
26. subtract AND assignment operator
truncate
print()
-=
str()
27. floor division AND assignment operator
-=
//=
round()
%r
28. reads just one line of a text file & keeps track of where in the file you're at
write
/
file.readline()
len()
29. turns an object into a string
&
for
str()
close
30. square root
~
write
math.sqrt(a)
str()
31. The keyword beginning a header that will create a loop.
%
%
del
for
32. A logical operator which returns a value of True if either of the conditions is true.
#
()
in
or
33. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
write
pass
+
class
34. Create a variable.
in
math.sqrt(a)
is
=
35. Prevents a runtime error from stopping the program.
str()
%s
def
except
36. An operator that removes a value from a list.
==
readline
a**b
del
37. A statement that displays a value on the screen.
format string
/=
print
%=
38. Less than or equal to symbol
n
//=
not in
<=
39. Writes stuff to the file.
in
*write(stuff)
def
for
40. 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
Variables
<<
==
*truncate
41. adds an item to a list
a**b
append()
%
len()
42. Function to write something to a file
insert()
write
int()
>
43. multiply AND assignment operator
len()
print()
insert()
*=
44. Symbol to divide by the number to the right of the symbol
/
>=
+
<
45. Prints a string to the screen which will be Unicode.
%s
a//b
/
>
46. modulus AND assignment operator
read
a**b
&
%=
47. Prints a string to the screen which is a signed decimal.
%d
*
def
a//b
48. floor division AND assignment operator
//=
break
=
int()
49. Symbol to add things together
and
str
n
+
50. turns an object into an integer
floating point number
argument variable
int()
>