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. Turns a line into a comment instead of executable code.
a**b
#
*readline
*truncate
2. This statement causes an exception.
and
if
|
raise
3. Less than or equal to symbol
append()
file.readline()
<=
del
4. 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
>>
+=
len()
<=
5. turns an object into an integer
input()
-
int()
truncate
6. modulus AND assignment operator
%=
<
n
.py
7. rounds a number to the number of decimal points you choose
else
for
round()
*write(stuff)
8. Reads the contents of the file you can assign the result to a variable.
print
*read
input()
not
9. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
%=
&
and
assignment
10. subtract AND assignment operator
-=
int()
in
=
11. This statement exits a function. The remaining lines of the function are not executed.
%s
return
int()
+=
12. A logical operator which requires two expressions to both be true.
~
/=
^
and
13. A statement that ends the current iteration of a loop but continues looping.
continue
input()
assignment
math.sqrt(a)
14. adds an item to a list
append()
len()
*=
else
15. Prints a string to the screen which will be Unicode.
float
%r
str
%s
16. writes stuff to the file
=
file.write(stuff)
class
#
17. 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
<<
.py
int
//=
18. Symbol used to create comments
%
assignment
<
#
19. rounds a number to the number of decimal points you choose
continue
=
a**b
round()
20. floor division
a//b
**=
%
a**b
21. adds an item to a list
argument variable
Variables
append()
readline
22. Symbol to add things together
=
>>
**=
+
23. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
file.truncate()
**=
insert()
24. ,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.
and
#
<<
25. An operator that removes a value from a list.
round()
open()
**=
del
26. single line comment
//=
*write(stuff)
#
%=
27. Argument variable
len()
write
argv
<<
28. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
input()
+
print()
29. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
elif (Else if)
#
|
*read
30. Argument variable
pass
len()
.py
argv
31. floor division AND assignment operator
=
//=
try
**=
32. This keyword in the body of a conditional - gives an alternative execution.
%
a//b
else
*readline
33. add AND assignment operator
return
-
not in
+=
34. prints its parameter to the console
n
append()
print()
a**b
35. This keyword begins the simplest form of a conditional statement.
if
a//b
str()
+
36. exponentiation
int()
*read
a**b
file.write(stuff)
37. Writes stuff to the file.
*write(stuff)
#
in
%s
38. The extension for Python scripts
for
<
=
.py
39. Symbol to add things together
+
math.sqrt(a)
|
def
40. square root
%s
argument variable
math.sqrt(a)
abs(a)
41. Greater than symbol
>
append()
insert()
~
42. inserts an item inside a list at a certain index
+=
in
insert()
<<
43. Prints a string to the screen which is converted using repr()
%r
=
insert()
<<
44. The keyword beginning a header that will create a new function.
def
not in
Variables
del
45. Less than or equal to symbol
|
==
<=
/
46. returns the length of a string (number of characters)
<<
len()
#
~
47. empties the file
del
file.truncate()
>=
else
48. add AND assignment operator
str()
n
+=
=
49. returns the length of a string (number of characters)
-=
len()
class
print()
50. Greater than symbol
else
try
>
*