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 a string to the screen which will be Unicode.
def
except
%s
==
2. 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
%
/=
<<
argv
3. Adds something to a variable
=
%
open()
not in
4. Function to empty the contents of a file - no recovery is possible
-
//=
truncate
not
5. Turns a line into a comment instead of executable code.
%s
#
try
n
6. Prevents a runtime error from stopping the program.
~
%d
close
except
7. This keyword begins the simplest form of a conditional statement.
if
#
()
print()
8. This statement exits a function. The remaining lines of the function are not executed.
a%b
Variables
abs(a)
return
9. A logical operator which returns a value of True if either of the conditions is true.
or
>
try
break
10. floor division AND assignment operator
/=
//=
%s
del
11. sets the file's current position
%=
file.seek()
n
insert()
12. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
close
+
**=
~
13. exponent AND assignment operator
*=
&
floating point number
**=
14. Reads the contents of the file you can assign the result to a variable.
**=
*read
if
/
15. Function to write something to a file
append()
#
break
write
16. modulo
<=
class
#
a%b
17. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
if
print
.py
try
18. empties the file
continue
<<
file.truncate()
-
19. modulus AND assignment operator
%=
+
>
^
20. adds an item to a list
math.sqrt(a)
is not
abs(a)
append()
21. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
a%b
+
str()
Variables
22. Reads just one line of a text file.
close
=
*readline
|
23. 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).
*=
file.write(stuff)
is not
%s
24. Symbol to divide by the number to the right of the symbol
/
Variables
int()
==
25. unction to read one line of a file
<
=
readline
:
26. deletes an item from a list
truncate
float
del
-=
27. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
%s
append()
del
28. Function to read the contents of a file
def
and
<
read
29. floor division AND assignment operator
abs(a)
//=
*
%
30. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
raise
&
>=
abs(a)
31. multiply AND assignment operator
readline
*=
*truncate
^
32. A statement that assigns a value to a variable.
#
assignment
<<
//=
33. 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
=
print
^
&
34. square root
=
math.sqrt(a)
*=
not in
35. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
%d
==
a//b
36. A built-in function that converts its argument to a string.
~
%r
str
+
37. Symbol to multiply things
except
*=
*
==
38. Prints a string to the screen which is converted using repr()
while
=
%=
%r
39. divide AND assignment operator
round()
>>
%s
/=
40. This keyword in the body of a conditional - gives an alternative execution.
#
~
else
is
41. Greater than symbol
if
print
abs(a)
>
42. 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.
Variables
not in
input()
Variables
43. Symbol to subtract things from each other
-
pass
argv
()
44. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
format string
int()
open()
45. Modulus operator. It's the remainder after division
%
file.truncate()
+
^
46. Modulus operator. It's the remainder after division
float
continue
%
insert()
47. End header line.
:
==
/=
not
48. deletes an item from a list
/
~
del
close
49. assignment operator
a//b
and
=
^
50. returns the length of a string (number of characters)
truncate
#
~
len()