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. rounds a number to the number of decimal points you choose
math.sqrt(a)
round()
if
+=
2. reads just one line of a text file & keeps track of where in the file you're at
n
file.readline()
read
%s
3. The keyword beginning a header that will create a new function.
int()
def
print
<
4. multiply AND assignment operator
-=
assignment
or
*=
5. A keyword that does nothing but fill space to indicate code which will be written later.
str()
del
file.readline()
pass
6. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
readline
is not
Variables
=
7. unction to read one line of a file
del
%s
*truncate
readline
8. Greater than or equal symbol.
not
>=
append()
def
9. asks the user for a response and returns that response
readline
for
input()
truncate
10. returns the length of a string (number of characters)
write
<
%s
len()
11. Function to close a file - it will not be able to be used again unless the file is opened.
and
close
int
+=
12. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
if
in
+=
open()
13. This keyword in the body of a conditional allows chained conditionals.
%
truncate
elif (Else if)
==
14. floor division AND assignment operator
//=
**=
=
print
15. divide AND assignment operator
/=
+
.py
#
16. floor division
==
>>
file.readline()
a//b
17. This keyword begins the simplest form of a conditional statement.
if
*
str
a//b
18. sets the file's current position
file.truncate()
file.seek()
append()
else
19. turns an object into an integer
and
/=
%d
int()
20. The extension for Python scripts
/=
read
.py
21. floor division
a//b
file.readline()
format string
^
22. Modulus operator. It's the remainder after division
%
>>
/
+
23. The keyword beginning a header that will create a loop.
~
for
.py
str()
24. asks the user for a response and returns that response
+
+
input()
or
25. Symbol to multiply things
abs(a)
and
truncate
*
26. Adds a new line character
input()
n
except
open()
27. floor division AND assignment operator
%r
//=
a%b
%s
28. This keyword begins the simplest form of a conditional statement.
close
#
if
file.readline()
29. Symbol to subtract things from each other
()
()
>>
-
30. add AND assignment operator
def
+=
and
append()
31. Create a variable.
insert()
write
int()
=
32. prints its parameter to the console
int
#
print()
%s
33. Less than symbol
input()
>=
else
<
34. A logical operator which returns a value of True if either of the conditions is true.
-
or
file.truncate()
in
35. 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
%s
//=
file.seek()
^
36. Argument variable
//=
str()
not
argv
37. Symbol to divide by the number to the right of the symbol
*=
in
/
-=
38. Less than or equal to symbol
==
%=
int()
<=
39. Prints a string to the screen which is a signed decimal.
-
try
%d
math.sqrt(a)
40. empties the file
open()
file.truncate()
write
a**b
41. Greater than or equal symbol.
.py
:
()
>=
42. Symbol used to create comments
*truncate
while
#
int
43. Writes stuff to the file.
*write(stuff)
pass
^
del
44. 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).
assignment
#
*
is not
45. single line comment
*=
is not
#
del
46. deletes an item from a list
input()
del
else
%s
47. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
==
^
in
Variables
48. This statement exits a function. The remaining lines of the function are not executed.
%
return
:
**=
49. Function to write something to a file
n
argv
for
write
50. Prints a string to the screen which is converted using repr()
%r
+
print()
open()