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. floor division
~
abs(a)
a//b
read
2. Modulus operator. It's the remainder after division
=
%
a//b
n
3. Symbol to subtract things from each other
-
**=
str
=
4. This statement exits a function. The remaining lines of the function are not executed.
**=
//=
return
read
5. This statement causes an exception.
raise
%=
/
append()
6. divide AND assignment operator
/=
close
%
int
7. absolute value
abs(a)
close
write
*
8. The keyword beginning a header that will create a loop.
def
math.sqrt(a)
for
*readline
9. A statement that displays a value on the screen.
def
<=
print
#
10. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
|
-
file.seek()
11. End header line.
write
#
:
+
12. Create a variable.
assignment
=
>
a%b
13. Reads just one line of a text file.
continue
for
*readline
in
14. This keyword begins the simplest form of a conditional statement.
if
file.seek()
print
int()
15. add AND assignment operator
n
+=
<=
print
16. Argument variable
=
argv
n
def
17. rounds a number to the number of decimal points you choose
if
=
+=
round()
18. prints its parameter to the console
print()
raise
==
in
19. exponent AND assignment operator
%
and
**=
|
20. Function to read the contents of a file
read
del
insert()
try
21. modulo
%
&
a%b
if
22. This keyword begins a header for a body that repeats until the condition is no longer true.
while
print
a%b
-=
23. Empties the file - watch out if you care about the file.
print()
&
math.sqrt(a)
*truncate
24. turns an object into a string
str()
else
argument variable
argv
25. 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
<<
while
**=
pass
26. Symbol to add things together
>
def
+
//=
27. The extension for Python scripts
file.readline()
.py
%d
=
28. A built-in function that converts its argument to a string.
<
str
==
>>
29. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
^
except
*=
Variables
30. multiply AND assignment operator
-=
len()
*=
/=
31. Less than or equal to symbol
>=
*write(stuff)
insert()
<=
32. An operator that removes a value from a list.
*readline
del
else
argv
33. absolute value
argument variable
abs(a)
or
|
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
file.truncate()
^
str
>>
35. Symbol to divide by the number to the right of the symbol
=
/=
file.write(stuff)
/
36. square root
math.sqrt(a)
in
=
%r
37. Modulus operator. It's the remainder after division
%
input()
format string
a**b
38. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
==
&
%s
>=
39. Function to close a file - it will not be able to be used again unless the file is opened.
and
argv
if
close
40. 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.
is not
*
*readline
argument variable
41. A statement that assigns a value to a variable.
input()
assignment
%s
#
42. multiply AND assignment operator
*=
print()
print
/=
43. subtract AND assignment operator
-=
^
format string
=
44. Prints a string to the screen which will be Unicode.
raise
input()
%s
n
45. Prints a string to the screen which is converted using repr()
%r
/
-=
=
46. writes stuff to the file
format string
while
file.write(stuff)
&
47. turns an object into an integer
int()
~
%s
a**b
48. asks the user for a response and returns that response
abs(a)
input()
*=
if
49. A built-in function that converts integers and strings to floating-point numbers.
a//b
if
file.truncate()
float
50. 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.
==
print
in
%d