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. 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
math.sqrt(a)
>=
>>
len()
2. Less than or equal to symbol
<=
==
truncate
//=
3. The keyword beginning a header that will create a new function.
|
-=
read
def
4. turns an object into a string
str()
read
==
or
5. subtract AND assignment operator
-=
file.write(stuff)
>
truncate
6. returns the length of a string (number of characters)
=
len()
append()
=
7. An operator that removes a value from a list.
del
#
in
else
8. multiply AND assignment operator
^
try
insert()
*=
9. A logical operator which returns a value of True if either of the conditions is true.
format string
or
/
**=
10. Prints a string to the screen which is converted using repr()
float
round()
%r
in
11. Reads just one line of a text file.
()
>=
read
*readline
12. unction to read one line of a file
readline
class
input()
-=
13. End header line.
insert()
print()
:
*=
14. Function to close a file - it will not be able to be used again unless the file is opened.
close
/=
def
-
15. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
a**b
del
class
for
16. Where the parameters go. A necessary punctuation after any function even if it's empty.
file.seek()
a**b
()
while
17. modulus AND assignment operator
readline
open()
%=
int
18. Adds something to a variable
a%b
if
=
%d
19. turns an object into a string
str()
write
print()
except
20. Symbol to divide by the number to the right of the symbol
%r
write
/
/=
21. absolute value
*=
==
readline
abs(a)
22. An operator to check whether two variables refer to the same object.
:
is
*
a%b
23. Create a variable.
>>
=
&
input()
24. Empties the file - watch out if you care about the file.
*truncate
del
=
Variables
25. modulo
abs(a)
>
a%b
+=
26. Function to empty the contents of a file - no recovery is possible
|
>>
truncate
round()
27. Symbol to add things together
>=
def
*=
+
28. Symbol to multiply things
<<
return
*
&
29. Function to write something to a file
^
write
Variables
30. add AND assignment operator
if
print
str
+=
31. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
>=
*readline
&
def
32. deletes an item from a list
>>
del
-=
print()
33. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
format string
*=
read
if
34. ,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.
=
elif (Else if)
-=
35. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
in
/=
%s
&
36. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
//=
+
&
37. adds an item to a list
append()
>>
print
%s
38. exponentiation
/=
or
and
a**b
39. Modulus operator. It's the remainder after division
write
*
%
*readline
40. Greater than symbol
>
float
print
-=
41. Symbol to divide by the number to the right of the symbol
int()
in
float
/
42. adds an item to a list
%=
print()
==
append()
43. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
del
^
/=
44. square root
str
math.sqrt(a)
n
>>
45. floor division
a//b
-
format string
argv
46. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
:
=
in
Variables
47. Command to print to the screen
print
truncate
input()
str
48. Prevents a runtime error from stopping the program.
Variables
for
except
>
49. The extension for Python scripts
a%b
.py
while
<
50. Greater than symbol
if
>
#
~