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. Symbol to divide by the number to the right of the symbol
a//b
*truncate
&
/
2. This keyword begins the simplest form of a conditional statement.
<
is
%d
if
3. Empties the file - watch out if you care about the file.
int()
*truncate
Variables
/
4. Prints a string to the screen which will be Unicode.
%s
truncate
-
%r
5. Symbol to subtract things from each other
.py
close
or
-
6. Command to print to the screen
print
try
%
~
7. turns an object into an integer
if
for
*readline
int()
8. 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
print
>>
else
math.sqrt(a)
9. turns an object into an integer
int()
|
break
return
10. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
a**b
str()
class
elif (Else if)
11. ,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.
&
<
*
12. Adds a new line character
n
>
>>
%d
13. sets the file's current position
file.seek()
=
<
abs(a)
14. square root
-=
in
*readline
math.sqrt(a)
15. Less than or equal to symbol
#
readline
*readline
<=
16. divide AND assignment operator
argv
/=
#
open()
17. inserts an item inside a list at a certain index
file.seek()
math.sqrt(a)
>>
insert()
18. Function to empty the contents of a file - no recovery is possible
open()
<
%s
truncate
19. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
+=
%=
*read
20. floor division AND assignment operator
str()
//=
argv
readline
21. The keyword beginning a header that will create a new function.
-
open()
a**b
def
22. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
a%b
del
float
23. asks the user for a response and returns that response
except
%r
floating point number
input()
24. Turns a line into a comment instead of executable code.
a**b
for
<
#
25. subtract AND assignment operator
-=
pass
str()
return
26. adds an item to a list
continue
str()
append()
a//b
27. Prints a string to the screen which is converted using repr()
%r
>=
/
open()
28. square root
str()
math.sqrt(a)
insert()
else
29. Where the parameters go. A necessary punctuation after any function even if it's empty.
while
()
print()
+
30. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
-
<
and
in
31. Argument variable
<<
input()
print()
argv
32. Prevents a runtime error from stopping the program.
%d
except
|
<
33. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
print
read
*write(stuff)
&
34. deletes an item from a list
.py
raise
del
%r
35. Reads the contents of the file you can assign the result to a variable.
>>
file.truncate()
*read
while
36. End header line.
>
:
read
float
37. A built-in function that converts integers and strings to floating-point numbers.
try
close
float
*=
38. returns the length of a string (number of characters)
and
n
len()
-=
39. The keyword beginning a header that will create a loop.
=
a//b
close
for
40. deletes an item from a list
del
write
readline
class
41. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
is
~
>
raise
42. turns an object into a string
close
str()
()
Variables
43. A logical operator which requires two expressions to both be true.
/
and
:
if
44. exponentiation
=
insert()
a**b
print()
45. This statement exits a function. The remaining lines of the function are not executed.
round()
return
/=
+=
46. The extension for Python scripts
>
.py
class
a%b
47. Function to write something to a file
class
%r
print
write
48. Symbol to add things together
+
or
if
*=
49. Create a variable.
*
=
continue
>>
50. This statement causes an exception.
+=
#
raise
math.sqrt(a)