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. floor division
a//b
and
format string
*=
2. 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
*truncate
for
Variables
<<
3. Empties the file - watch out if you care about the file.
/
int()
insert()
*truncate
4. Greater than or equal symbol.
>=
~
%r
%s
5. prints its parameter to the console
+=
file.seek()
.py
print()
6. Modulus operator. It's the remainder after division
truncate
<<
%
+=
7. empties the file
.py
^
file.truncate()
argv
8. rounds a number to the number of decimal points you choose
round()
if
.py
a//b
9. Symbol to subtract things from each other
*truncate
^
float
-
10. 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
()
len()
^
not in
11. Function to read the contents of a file
read
==
.py
print
12. Prevents a runtime error from stopping the program.
close
*readline
except
a//b
13. An operator to check whether two variables refer to the same object.
len()
is
-
float
14. A statement that ends the current iteration of a loop but continues looping.
^
%s
continue
print
15. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
not
n
format string
%
16. A built-in function that converts integers and strings to floating-point numbers.
float
else
math.sqrt(a)
|
17. Greater than or equal symbol.
readline
not in
format string
>=
18. 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).
is not
%r
float
a%b
19. A logical operator which requires two expressions to both be true.
int()
%r
and
file.readline()
20. Prints a string to the screen which will be Unicode.
def
read
<
%s
21. inserts an item inside a list at a certain index
insert()
readline
%=
str()
22. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
&
~
math.sqrt(a)
str()
23. deletes an item from a list
write
a//b
<=
del
24. Command to print to the screen
*write(stuff)
int()
print
~
25. Greater than symbol
%
-
#
>
26. Greater than symbol
def
not
>
#
27. Symbol used to create comments
len()
#
int()
a//b
28. exponentiation
=
a**b
-=
*read
29. inserts an item inside a list at a certain index
+=
insert()
>=
a%b
30. This keyword begins a header for a body that repeats until the condition is no longer true.
>>
while
:
input()
31. Adds something to a variable
del
open()
**=
=
32. The extension for Python scripts
*=
>>
input()
.py
33. Turns a line into a comment instead of executable code.
a**b
input()
#
-
34. Prints a string to the screen which is converted using repr()
print
%r
+
argument variable
35. deletes an item from a list
a//b
**=
del
for
36. An operator that removes a value from a list.
*
def
for
del
37. Create a variable.
*
=
str
38. The keyword beginning a header that will create a loop.
for
&
>
len()
39. Prints a string to the screen which is a signed decimal.
%d
%=
truncate
open()
40. modulo
<<
a%b
>
open()
41. A statement that assigns a value to a variable.
assignment
*read
+
//=
42. Reads the contents of the file you can assign the result to a variable.
=
write
def
*read
43. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
Variables
file.write(stuff)
//=
|
44. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
==
argv
elif (Else if)
45. This statement exits a function. The remaining lines of the function are not executed.
return
readline
<
write
46. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
close
def
>
47. A logical operator which returns a value of True if either of the conditions is true.
-=
or
#
try
48. A statement that displays a value on the screen.
print
()
&
**=
49. unction to read one line of a file
:
del
readline
not in
50. multiply AND assignment operator
not in
read
*=
-