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. This statement causes an exception.
close
raise
%=
is
2. Prevents a runtime error from stopping the program.
~
try
print
except
3. unction to read one line of a file
<
-=
readline
else
4. The extension for Python scripts
.py
/=
%
print
5. Symbol to subtract things from each other
-
Variables
del
/
6. divide AND assignment operator
write
argument variable
/=
len()
7. End header line.
readline
+
file.seek()
:
8. The extension for Python scripts
assignment
.py
insert()
argv
9. Symbol to add things together
+
.py
is not
len()
10. Prints a string to the screen which is converted using repr()
argv
#
del
%r
11. Function to empty the contents of a file - no recovery is possible
**=
/
truncate
try
12. Reads just one line of a text file.
*readline
=
n
floating point number
13. Reads the contents of the file you can assign the result to a variable.
a**b
*read
if
<=
14. assignment operator
*readline
print
~
=
15. empties the file
file.truncate()
/=
del
readline
16. multiply AND assignment operator
file.seek()
pass
argument variable
*=
17. This statement exits a function. The remaining lines of the function are not executed.
is
del
write
return
18. asks the user for a response and returns that response
>>
input()
print
assignment
19. This keyword in the body of a conditional - gives an alternative execution.
~
else
>=
-
20. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).
elif (Else if)
while
file.seek()
is not
21. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
=
|
%r
/
22. Empties the file - watch out if you care about the file.
*truncate
~
read
%=
23. absolute value
floating point number
abs(a)
input()
/=
24. writes stuff to the file
file.write(stuff)
del
()
%=
25. Prints a string to the screen which will be Unicode.
del
%s
*truncate
Variables
26. subtract AND assignment operator
*=
^
-=
in
27. single line comment
#
not in
str()
input()
28. Modulus operator. It's the remainder after division
assignment
return
%
try
29. A logical operator which negates an expression so that it returns a value of True if the expression is false.
-=
abs(a)
except
not
30. Argument variable
and
truncate
argv
31. sets the file's current position
print()
file.seek()
print
open()
32. Symbol used to create comments
-=
#
print
%
33. A statement that breaks out of a loop.
del
break
*readline
close
34. square root
abs(a)
except
math.sqrt(a)
not
35. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
*
def
class
~
36. assignment operator
**=
=
a//b
n
37. Less than or equal to symbol
=
a**b
truncate
<=
38. exponent AND assignment operator
**=
#
assignment
%
39. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
round()
|
abs(a)
else
40. turns an object into a string
str()
truncate
**=
is not
41. This keyword in the body of a conditional allows chained conditionals.
*write(stuff)
round()
<
elif (Else if)
42. 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.
append()
input()
argument variable
.py
43. turns an object into an integer
()
close
int()
else
44. Function to read the contents of a file
%=
read
^
abs(a)
45. A data type for representing numbers with fractional values.
floating point number
*
-
argument variable
46. Symbol to subtract things from each other
-
try
else
for
47. Create a variable.
&
==
/
=
48. Function to write something to a file
a%b
%=
write
abs(a)
49. Function to write something to a file
math.sqrt(a)
<
a%b
write
50. Command to print to the screen
print
write
/
file.readline()