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. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.
>
readline
<=
not in
2. floor division AND assignment operator
//=
file.seek()
print
readline
3. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
%s
>=
class
try
4. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
readline
%r
assignment
5. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.
print()
.py
Variables
6. Function to empty the contents of a file - no recovery is possible
in
write
truncate
**=
7. 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
open()
for
<<
argument variable
8. Where the parameters go. A necessary punctuation after any function even if it's empty.
*
:
del
()
9. absolute value
round()
truncate
abs(a)
file.seek()
10. Reads the contents of the file you can assign the result to a variable.
*read
int
+
floating point number
11. Function to close a file - it will not be able to be used again unless the file is opened.
close
try
argument variable
()
12. Argument variable
==
.py
argv
append()
13. End header line.
int
:
>=
del
14. Less than symbol
%
readline
<
<=
15. Prints a string to the screen which is a signed decimal.
%d
del
append()
<=
16. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
#
float
()
&
17. Prints a string to the screen which will be Unicode.
open()
>
.py
%s
18. exponent AND assignment operator
open()
**=
if
class
19. Greater than symbol
print()
>
readline
=
20. A statement that ends the current iteration of a loop but continues looping.
except
continue
del
elif (Else if)
21. Adds something to a variable
=
return
#
n
22. 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.
argv
is not
not in
argument variable
23. Greater than or equal symbol.
*truncate
>=
close
truncate
24. multiply AND assignment operator
Variables
*=
|
for
25. Turns a line into a comment instead of executable code.
round()
:
>>
#
26. 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
argument variable
close
<<
%d
27. 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).
#
a//b
is not
floating point number
28. exponentiation
#
=
len()
a**b
29. Prevents a runtime error from stopping the program.
def
round()
except
del
30. multiply AND assignment operator
*=
try
in
not in
31. A logical operator which requires two expressions to both be true.
>
open()
and
write
32. A data type for representing numbers with fractional values.
str
floating point number
%d
=
33. Where the parameters go. A necessary punctuation after any function even if it's empty.
*=
()
**=
print
34. This keyword in the body of a conditional allows chained conditionals.
print
%s
elif (Else if)
append()
35. sets the file's current position
+=
math.sqrt(a)
close
file.seek()
36. The keyword beginning a header that will create a new function.
def
/
^
try
37. absolute value
*readline
abs(a)
#
*read
38. modulo
in
%d
a%b
write
39. The extension for Python scripts
.py
float
//=
def
40. A logical operator which compares two operands and produces True if they are equal and False otherwise
append()
==
def
int()
41. Less than or equal to symbol
except
==
break
<=
42. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
if
int
n
else
43. This keyword begins the simplest form of a conditional statement.
print()
if
input()
for
44. inserts an item inside a list at a certain index
**=
insert()
else
.py
45. Reads just one line of a text file.
round()
:
*readline
close
46. adds an item to a list
readline
def
str
append()
47. A statement that breaks out of a loop.
break
math.sqrt(a)
class
readline
48. single line comment
#
try
**=
write
49. Symbol to add things together
%=
%
raise
+
50. Less than or equal to symbol
a//b
not in
<=
>