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. A keyword that does nothing but fill space to indicate code which will be written later.
.py
*
*
pass
2. exponentiation
float
a**b
argv
~
3. Adds a new line character
n
a//b
file.truncate()
not in
4. The keyword beginning a header that will create a loop.
readline
raise
for
^
5. Prints a string to the screen which will be Unicode.
%s
-
+
=
6. Where the parameters go. A necessary punctuation after any function even if it's empty.
append()
-=
>>
()
7. Function to empty the contents of a file - no recovery is possible
truncate
str()
%=
str
8. empties the file
write
file.truncate()
readline
insert()
9. deletes an item from a list
del
-=
|
-
10. inserts an item inside a list at a certain index
insert()
truncate
>>
%s
11. Symbol to divide by the number to the right of the symbol
/
n
%s
&
12. Prints a string to the screen which is converted using repr()
is
%r
>>
argv
13. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
read
%
:
|
14. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
file.readline()
input()
and
in
15. floor division
in
a//b
%=
insert()
16. Greater than or equal symbol.
>=
%=
a**b
write
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
a//b
|
a%b
<<
18. 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
<<
int
%d
()
19. Function to write something to a file
#
insert()
%=
write
20. Less than symbol
#
<
len()
print
21. Prints a string to the screen which is a signed decimal.
%
%r
**=
%d
22. Where the parameters go. A necessary punctuation after any function even if it's empty.
try
int()
>
()
23. This keyword begins the simplest form of a conditional statement.
if
<=
*write(stuff)
>
24. The extension for Python scripts
-=
|
.py
write
25. square root
-=
for
math.sqrt(a)
>
26. add AND assignment operator
+=
insert()
>=
def
27. Command to print to the screen
Variables
%s
print
else
28. A logical operator which returns a value of True if either of the conditions is true.
=
print
or
for
29. This keyword in the body of a conditional allows chained conditionals.
+
elif (Else if)
%d
^
30. Symbol to add things together
#
+
a%b
file.write(stuff)
31. 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).
#
math.sqrt(a)
return
is not
32. This keyword in the body of a conditional - gives an alternative execution.
and
*=
continue
else
33. returns the length of a string (number of characters)
del
file.readline()
*truncate
len()
34. modulus AND assignment operator
%=
readline
continue
file.truncate()
35. Function to close a file - it will not be able to be used again unless the file is opened.
math.sqrt(a)
==
close
a**b
36. returns the length of a string (number of characters)
a**b
continue
append()
len()
37. Prints a string to the screen which is converted using repr()
del
>>
%r
truncate
38. multiply AND assignment operator
*=
len()
assignment
insert()
39. Symbol to subtract things from each other
#
-
str()
>>
40. A built-in function that converts its argument to a string.
str()
str
-=
is
41. This keyword begins a header for a body that repeats until the condition is no longer true.
abs(a)
is
while
a//b
42. A statement that ends the current iteration of a loop but continues looping.
round()
is
>>
continue
43. Create a variable.
truncate
or
=
elif (Else if)
44. exponent AND assignment operator
**=
raise
abs(a)
abs(a)
45. A logical operator which compares two operands and produces True if they are equal and False otherwise
print
floating point number
==
%d
46. This statement exits a function. The remaining lines of the function are not executed.
return
+
a**b
~
47. Symbol to add things together
+
%d
/=
*write(stuff)
48. A statement that displays a value on the screen.
print
file.seek()
=
insert()
49. assignment operator
<
break
%
=
50. A built-in function that converts integers and strings to floating-point numbers.
while
%
float
*readline