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. writes stuff to the file
file.write(stuff)
%=
a**b
%=
2. Symbol used to create comments
file.write(stuff)
>>
#
=
3. rounds a number to the number of decimal points you choose
=
round()
try
readline
4. A built-in function that converts its argument to a string.
#
.py
read
str
5. End header line.
:
/
#
()
6. multiply AND assignment operator
*=
/
>
~
7. floor division
a//b
%
>
>>
8. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
Variables
^
a//b
&
9. Reads the contents of the file you can assign the result to a variable.
*read
//=
Variables
<<
10. assignment operator
break
pass
=
11. absolute value
#
format string
floating point number
abs(a)
12. Empties the file - watch out if you care about the file.
()
*truncate
len()
<<
13. An operator that removes a value from a list.
=
readline
a**b
del
14. Symbol to add things together
for
+
str()
-
15. Create a variable.
//=
def
+=
=
16. unction to read one line of a file
a%b
str()
math.sqrt(a)
readline
17. A statement that breaks out of a loop.
~
break
=
=
18. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
%
open()
assignment
19. Less than or equal to symbol
<=
+
-
elif (Else if)
20. square root
math.sqrt(a)
and
except
float
21. This keyword begins the simplest form of a conditional statement.
>=
=
round()
if
22. The extension for Python scripts
floating point number
read
open()
.py
23. divide AND assignment operator
if
len()
str()
/=
24. Less than symbol
+=
>>
a//b
<
25. This statement exits a function. The remaining lines of the function are not executed.
close
*=
return
a//b
26. This keyword begins a header for a body that repeats until the condition is no longer true.
<
del
for
while
27. inserts an item inside a list at a certain index
not in
/
print()
insert()
28. floor division AND assignment operator
//=
write
+
<
29. Symbol used to create comments
=
or
int()
#
30. Prints a string to the screen which is converted using repr()
%s
|
>
%r
31. Function to empty the contents of a file - no recovery is possible
>=
+=
truncate
~
32. Prevents a runtime error from stopping the program.
except
def
a**b
read
33. assignment operator
insert()
<
=
>
34. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
=
/=
#
35. Less than or equal to symbol
>>
<=
.py
continue
36. Adds something to a variable
#
*truncate
=
format string
37. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.
.py
%s
continue
38. A built-in function that converts integers and strings to floating-point numbers.
%
float
try
()
39. Function to write something to a file
a//b
%d
a%b
write
40. floor division AND assignment operator
+=
//=
&
class
41. divide AND assignment operator
read
write
/=
return
42. 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
while
except
in
>>
43. Symbol to multiply things
<
raise
str()
*
44. exponentiation
str()
=
~
a**b
45. 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).
>>
print()
is not
*=
46. Command to print to the screen
else
//=
a%b
print
47. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
str
Variables
file.readline()
%r
48. Argument variable
round()
file.write(stuff)
argv
#
49. 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
file.readline()
*=
<<
del
50. turns an object into a string
print()
str()
float
<<