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. Argument variable
print
argv
truncate
len()
2. exponent AND assignment operator
%=
print
**=
close
3. floor division AND assignment operator
~
append()
<
//=
4. prints its parameter to the console
print()
=
=
readline
5. A logical operator which compares two operands and produces True if they are equal and False otherwise
<=
write
*=
==
6. exponentiation
read
a**b
and
.py
7. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
not
&
else
format string
8. This statement causes an exception.
raise
not
+=
n
9. exponentiation
file.seek()
*read
a**b
+=
10. The keyword beginning a header that will create a new function.
%r
for
def
close
11. single line comment
math.sqrt(a)
read
#
*truncate
12. Function to write something to a file
continue
write
+=
not
13. A logical operator which requires two expressions to both be true.
=
#
^
and
14. modulus AND assignment operator
file.truncate()
int
%=
#
15. floor division
print()
=
a//b
int()
16. Function to open or read a file
open()
print
%d
17. Adds something to a variable
pass
:
=
>>
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
<<
+=
break
>>
19. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
/
<<
>>
20. Prints a string to the screen which will be Unicode.
is
int()
%s
%d
21. A statement that breaks out of a loop.
break
and
in
is not
22. A keyword that does nothing but fill space to indicate code which will be written later.
-
close
a//b
pass
23. This keyword in the body of a conditional - gives an alternative execution.
print
else
n
*readline
24. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
str()
argument variable
25. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
math.sqrt(a)
%
int()
26. Adds a new line character
%d
and
//=
n
27. Greater than symbol
argv
>
*write(stuff)
>>
28. Function to write something to a file
&
write
and
abs(a)
29. adds an item to a list
assignment
append()
pass
.py
30. Less than symbol
%d
/=
<
truncate
31. This keyword begins the simplest form of a conditional statement.
()
#
if
for
32. The keyword beginning a header that will create a new function.
/=
>>
def
n
33. Less than or equal to symbol
-=
format string
<=
#
34. 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).
break
is not
and
len()
35. Symbol to divide by the number to the right of the symbol
-=
*
readline
/
36. A logical operator which compares two operands and produces True if they are equal and False otherwise
or
n
==
*read
37. Writes stuff to the file.
%r
*write(stuff)
%=
truncate
38. Function to empty the contents of a file - no recovery is possible
readline
input()
truncate
round()
39. This keyword in the body of a conditional - gives an alternative execution.
else
class
not in
continue
40. adds an item to a list
<<
%d
append()
while
41. deletes an item from a list
del
=
=
try
42. Prints a string to the screen which is converted using repr()
*=
break
%r
n
43. floor division
def
def
a//b
else
44. A logical operator which negates an expression so that it returns a value of True if the expression is false.
math.sqrt(a)
*readline
argument variable
not
45. An operator to check whether two variables refer to the same object.
is
print
open()
>=
46. reads just one line of a text file & keeps track of where in the file you're at
else
file.readline()
|
#
47. Reads just one line of a text file.
=
def
*readline
while
48. asks the user for a response and returns that response
input()
del
floating point number
#
49. Adds something to a variable
argv
=
for
Variables
50. turns an object into a string
str()
is not
+=
open()