SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
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. exponentiation
//=
a**b
read
<
2. turns an object into a string
~
del
int()
str()
3. Function to write something to a file
>=
<=
>>
write
4. Adds a new line character
-
^
%d
n
5. 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
>>
try
and
#
6. Function to open or read a file
in
=
file.readline()
open()
7. This keyword in the body of a conditional allows chained conditionals.
print
del
elif (Else if)
file.truncate()
8. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001
format string
^
*read
else
9. Prints a string to the screen which is converted using repr()
**=
%r
open()
round()
10. square root
&
math.sqrt(a)
>
is not
11. Prints a string to the screen which will be Unicode.
%=
return
//=
%s
12. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
len()
/=
math.sqrt(a)
in
13. Adds something to a variable
*
a//b
=
%s
14. Writes stuff to the file.
truncate
|
*write(stuff)
abs(a)
15. reads just one line of a text file & keeps track of where in the file you're at
-
except
file.readline()
del
16. Symbol to subtract things from each other
<<
assignment
-
def
17. 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
==
18. This statement causes an exception.
raise
abs(a)
readline
>=
19. A statement that assigns a value to a variable.
assignment
argv
a//b
^
20. sets the file's current position
:
file.seek()
open()
not in
21. Function to empty the contents of a file - no recovery is possible
truncate
-
<<
read
22. 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).
not in
:
is not
+
23. The extension for Python scripts
^
/=
.py
round()
24. Adds a new line character
=
%=
n
insert()
25. An operator that removes a value from a list.
del
*readline
str
append()
26. Modulus operator. It's the remainder after division
continue
=
and
%
27. adds an item to a list
append()
<
argument variable
+
28. Reads the contents of the file you can assign the result to a variable.
Variables
%s
math.sqrt(a)
*read
29. turns an object into an integer
*readline
append()
&
int()
30. turns an object into a string
str()
Variables
file.seek()
a**b
31. A built-in function that converts integers and strings to floating-point numbers.
append()
write
float
argv
32. The keyword beginning a header that will create a loop.
else
for
int()
close
33. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
del
~
==
else
34. Reads just one line of a text file.
+
#
*readline
*=
35. empties the file
<<
input()
-
file.truncate()
36. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
|
==
continue
37. Less than or equal to symbol
<=
**=
write
/=
38. rounds a number to the number of decimal points you choose
int()
print
round()
append()
39. turns an object into an integer
~
else
is
int()
40. Symbol to divide by the number to the right of the symbol
and
else
/
read
41. Symbol used to create comments
n
#
+=
*
42. An operator to check whether two variables refer to the same object.
not in
>>
>=
is
43. square root
raise
else
math.sqrt(a)
a%b
44. asks the user for a response and returns that response
input()
a//b
/=
%s
45. A statement that displays a value on the screen.
:
print
n
continue
46. subtract AND assignment operator
-=
+=
argv
is not
47. This keyword begins the simplest form of a conditional statement.
read
if
:
/
48. exponent AND assignment operator
write
float
=
**=
49. Turns a line into a comment instead of executable code.
#
<<
a//b
&
50. writes stuff to the file
==
>=
file.write(stuff)
=