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. prints its parameter to the console
print()
del
Variables
input()
2. Function to open or read a file
*=
print
/
open()
3. multiply AND assignment operator
#
*=
+
file.seek()
4. The keyword beginning a header that will create a loop.
-
%=
for
5. returns the length of a string (number of characters)
/=
or
len()
int()
6. Function to write something to a file
write
#
|
append()
7. Prints a string to the screen which is a signed decimal.
^
==
%d
^
8. Argument variable
argv
a//b
-=
/=
9. modulo
print()
%=
a%b
if
10. This keyword begins the simplest form of a conditional statement.
*readline
if
elif (Else if)
%d
11. A logical operator which compares two operands and produces True if they are equal and False otherwise
or
==
floating point number
print
12. Function to empty the contents of a file - no recovery is possible
n
truncate
=
:
13. Adds a new line character
for
n
except
close
14. Adds something to a variable
|
^
=
is not
15. Where the parameters go. A necessary punctuation after any function even if it's empty.
int()
=
not in
()
16. deletes an item from a list
del
read
%=
*=
17. asks the user for a response and returns that response
-=
*=
input()
int()
18. This keyword in the body of a conditional allows chained conditionals.
~
elif (Else if)
file.truncate()
a**b
19. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
*
readline
in
if
20. exponent AND assignment operator
=
.py
float
**=
21. 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
n
%r
<<
<
22. multiply AND assignment operator
open()
>=
*=
-
23. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
elif (Else if)
#
>
24. turns an object into a string
str()
math.sqrt(a)
len()
while
25. Empties the file - watch out if you care about the file.
*
+
*truncate
:
26. Command to print to the screen
#
+=
argv
print
27. adds an item to a list
=
^
>>
append()
28. prints its parameter to the console
abs(a)
<
except
print()
29. 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
=
input()
==
30. Create a variable.
/=
=
*=
not
31. inserts an item inside a list at a certain index
insert()
Variables
def
raise
32. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
=
&
append()
return
33. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
file.truncate()
class
int
assignment
34. The keyword beginning a header that will create a new function.
def
n
>>
format string
35. Function to read the contents of a file
=
read
//=
#
36. Less than or equal to symbol
pass
return
<=
write
37. Prevents a runtime error from stopping the program.
>
int
|
except
38. Prints a string to the screen which will be Unicode.
and
%s
math.sqrt(a)
//=
39. Prints a string to the screen which is converted using repr()
%s
%r
:
len()
40. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
str
floating point number
for
class
41. Function to write something to a file
write
>=
math.sqrt(a)
readline
42. empties the file
file.truncate()
assignment
argv
+
43. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
print()
.py
and
44. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
<
*=
%r
45. adds an item to a list
<
def
round()
append()
46. A statement that breaks out of a loop.
break
%r
%d
:
47. Less than or equal to symbol
read
()
<=
.py
48. Reads just one line of a text file.
*readline
insert()
print
str()
49. Less than symbol
abs(a)
truncate
^
<
50. Where the parameters go. A necessary punctuation after any function even if it's empty.
<
insert()
()
%