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. This statement causes an exception.
a//b
raise
~
2. Argument variable
~
a**b
argv
insert()
3. A built-in function that converts its argument to a string.
is not
+
str
^
4. assignment operator
=
try
in
math.sqrt(a)
5. sets the file's current position
Variables
file.seek()
abs(a)
==
6. modulo
>
*
a%b
//=
7. Where the parameters go. A necessary punctuation after any function even if it's empty.
round()
()
+=
**=
8. Prints a string to the screen which is converted using repr()
**=
%r
<
>>
9. 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
//=
<
<<
math.sqrt(a)
10. Less than symbol
<
-=
=
n
11. Symbol used to create comments
.py
n
if
#
12. Modulus operator. It's the remainder after division
n
append()
%
>=
13. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
%r
~
%
else
14. A statement that displays a value on the screen.
print
file.truncate()
float
<<
15. deletes an item from a list
-
del
or
%d
16. Function to write something to a file
.py
write
read
%d
17. Function to close a file - it will not be able to be used again unless the file is opened.
close
raise
<<
truncate
18. Reads the contents of the file you can assign the result to a variable.
+
file.truncate()
*read
*=
19. This keyword in the body of a conditional - gives an alternative execution.
str()
str
else
del
20. The extension for Python scripts
.py
*
^
del
21. exponent AND assignment operator
def
abs(a)
//=
**=
22. inserts an item inside a list at a certain index
insert()
n
raise
23. Greater than symbol
~
&
else
>
24. Adds something to a variable
.py
=
()
argv
25. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
/=
in
not
a**b
26. turns an object into an integer
int()
>>
>>
=
27. A data type for representing numbers with fractional values.
floating point number
|
del
<
28. square root
print
math.sqrt(a)
<=
def
29. The keyword beginning a header that will create a loop.
%s
for
class
a//b
30. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.
input()
argument variable
=
%d
31. turns an object into a string
*readline
input()
str()
/=
32. Where the parameters go. A necessary punctuation after any function even if it's empty.
abs(a)
len()
^
()
33. A built-in function that converts integers and strings to floating-point numbers.
float
int()
if
a**b
34. Create a variable.
=
a//b
file.write(stuff)
+
35. divide AND assignment operator
-=
/=
:
and
36. The keyword beginning a header that will create a new function.
def
input()
in
not in
37. The keyword beginning a header that will create a new function.
>=
class
def
/=
38. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
*write(stuff)
&
file.readline()
math.sqrt(a)
39. rounds a number to the number of decimal points you choose
truncate
/
insert()
round()
40. Command to print to the screen
read
<<
for
print
41. A statement that assigns a value to a variable.
>
assignment
%=
%
42. turns an object into a string
:
str()
or
try
43. Empties the file - watch out if you care about the file.
append()
==
>>
*truncate
44. unction to read one line of a file
readline
%
print
<<
45. inserts an item inside a list at a certain index
a//b
insert()
<
%d
46. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
Variables
is not
input()
47. floor division AND assignment operator
else
+
a%b
//=
48. A logical operator which negates an expression so that it returns a value of True if the expression is false.
*
not
round()
and
49. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
//=
int()
Variables
def
50. Function to read the contents of a file
=
not
/
read