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. deletes an item from a list
*=
abs(a)
del
in
2. Prints a string to the screen which is a signed decimal.
*=
%d
**=
def
3. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
%s
float
~
%s
4. Reads the contents of the file you can assign the result to a variable.
append()
*read
a%b
=
5. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
:
|
%d
&
6. subtract AND assignment operator
truncate
insert()
+
-=
7. Adds something to a variable
append()
a%b
argument variable
=
8. This statement exits a function. The remaining lines of the function are not executed.
-
and
return
del
9. Symbol to subtract things from each other
or
read
/
-
10. Where the parameters go. A necessary punctuation after any function even if it's empty.
print
:
()
==
11. Function to empty the contents of a file - no recovery is possible
n
continue
truncate
^
12. divide AND assignment operator
/=
*
<<
close
13. Function to write something to a file
/
=
write
~
14. 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
<=
>>
//=
print
15. Argument variable
not in
argv
-=
round()
16. A data type for representing numbers with fractional values.
*=
file.readline()
floating point number
in
17. divide AND assignment operator
print
and
argv
/=
18. Empties the file - watch out if you care about the file.
=
a%b
*truncate
&
19. modulo
in
a%b
print
in
20. Adds something to a variable
()
elif (Else if)
//=
=
21. A keyword that does nothing but fill space to indicate code which will be written later.
continue
raise
pass
22. Greater than symbol
|
>
read
for
23. Symbol to divide by the number to the right of the symbol
/
#
or
print()
24. modulo
str()
readline
|
a%b
25. exponentiation
==
insert()
else
a**b
26. Command to print to the screen
print
%=
del
>=
27. returns the length of a string (number of characters)
%r
insert()
%d
len()
28. Prints a string to the screen which is converted using repr()
read
write
%r
()
29. Argument variable
=
.py
==
argv
30. square root
a**b
math.sqrt(a)
del
write
31. ,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.
%s
readline
input()
32. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
>
try
write
a%b
33. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
and
print
%d
Variables
34. assignment operator
argv
=
insert()
|
35. Writes stuff to the file.
abs(a)
str
*write(stuff)
n
36. Modulus operator. It's the remainder after division
a%b
print
%
append()
37. A logical operator which returns a value of True if either of the conditions is true.
()
or
=
class
38. This keyword in the body of a conditional allows chained conditionals.
del
elif (Else if)
//=
input()
39. floor division
*truncate
a//b
and
|
40. This keyword in the body of a conditional - gives an alternative execution.
:
/
math.sqrt(a)
else
41. multiply AND assignment operator
argv
close
*=
%r
42. Prints a string to the screen which is converted using repr()
while
in
%r
truncate
43. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
.py
Variables
round()
/
44. An operator to check whether two variables refer to the same object.
is
del
del
*readline
45. Prints a string to the screen which will be Unicode.
%
|
print()
%s
46. Less than symbol
>=
<
=
else
47. rounds a number to the number of decimal points you choose
round()
file.readline()
+=
input()
48. The extension for Python scripts
str()
a**b
file.seek()
.py
49. A statement that assigns a value to a variable.
<<
pass
print
assignment
50. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
and
~
abs(a)
*readline