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. 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
=
2. This keyword begins a header for a body that repeats until the condition is no longer true.
while
()
**=
file.write(stuff)
3. turns an object into an integer
try
%=
else
int()
4. Prints a string to the screen which is converted using repr()
%r
n
insert()
input()
5. exponentiation
n
a//b
%r
a**b
6. A logical operator which compares two operands and produces True if they are equal and False otherwise
print
==
&
or
7. prints its parameter to the console
print()
*=
str
def
8. absolute value
for
+=
abs(a)
del
9. Greater than or equal symbol.
truncate
>=
return
del
10. The keyword beginning a header that will create a new function.
def
del
>
str()
11. Symbol to multiply things
file.readline()
|
*
round()
12. floor division AND assignment operator
print
>
round()
//=
13. End header line.
else
is not
break
:
14. This keyword begins the simplest form of a conditional statement.
print
input()
a**b
if
15. Greater than or equal symbol.
#
print()
try
>=
16. Writes stuff to the file.
int()
*write(stuff)
^
file.truncate()
17. modulus AND assignment operator
and
==
%=
=
18. deletes an item from a list
file.readline()
argument variable
readline
del
19. Create a variable.
del
=
#
not
20. Function to empty the contents of a file - no recovery is possible
/
%r
truncate
str
21. Modulus operator. It's the remainder after division
argv
math.sqrt(a)
%
str()
22. deletes an item from a list
pass
a//b
del
open()
23. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
raise
a%b
int()
24. Greater than symbol
~
else
format string
>
25. A statement that displays a value on the screen.
n
print
//=
readline
26. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
and
return
print
*
27. Reads the contents of the file you can assign the result to a variable.
*read
|
>>
<<
28. 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
a%b
>>
write
and
29. inserts an item inside a list at a certain index
math.sqrt(a)
%s
insert()
append()
30. square root
del
%
=
math.sqrt(a)
31. A logical operator which requires two expressions to both be true.
>
and
else
del
32. Function to close a file - it will not be able to be used again unless the file is opened.
str()
file.write(stuff)
close
is
33. exponent AND assignment operator
def
a%b
**=
%
34. Symbol to subtract things from each other
-
<=
/
a//b
35. turns an object into an integer
=
int()
//=
is not
36. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
/
str
~
-=
37. modulo
|
input()
a%b
close
38. reads just one line of a text file & keeps track of where in the file you're at
for
file.readline()
readline
print()
39. This keyword in the body of a conditional - gives an alternative execution.
*write(stuff)
else
-
len()
40. adds an item to a list
=
write
append()
<<
41. Symbol to divide by the number to the right of the symbol
/
//=
len()
readline
42. Function to empty the contents of a file - no recovery is possible
truncate
Variables
for
n
43. unction to read one line of a file
readline
a**b
^
=
44. adds an item to a list
append()
/
*=
%s
45. modulus AND assignment operator
readline
%=
int
Variables
46. The extension for Python scripts
.py
n
-
<<
47. Less than or equal to symbol
raise
<=
round()
#
48. This keyword begins the simplest form of a conditional statement.
%d
if
def
a%b
49. subtract AND assignment operator
-=
format string
a//b
continue
50. Less than symbol
<
format string
%s
n