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 is a signed decimal.
-
and
%d
<
2. A logical operator which returns a value of True if either of the conditions is true.
.py
or
n
=
3. Function to read the contents of a file
assignment
#
and
read
4. subtract AND assignment operator
is not
-=
:
&
5. Reads the contents of the file you can assign the result to a variable.
*read
#
*=
insert()
6. multiply AND assignment operator
append()
/=
n
*=
7. adds an item to a list
append()
return
>>
argument variable
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
^
%d
readline
append()
9. 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
del
<<
%
**=
10. This keyword begins the simplest form of a conditional statement.
if
%s
%
print
11. subtract AND assignment operator
-=
or
open()
%d
12. Symbol to subtract things from each other
#
break
-
file.write(stuff)
13. A logical operator which requires two expressions to both be true.
>>
Variables
==
and
14. divide AND assignment operator
/=
#
+=
pass
15. ,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.
file.seek()
read
def
16. returns the length of a string (number of characters)
len()
<=
else
except
17. Function to empty the contents of a file - no recovery is possible
print()
truncate
format string
print
18. A statement that displays a value on the screen.
truncate
print
print()
~
19. Function to open or read a file
truncate
open()
/
def
20. Symbol to subtract things from each other
-
del
#
input()
21. A logical operator which negates an expression so that it returns a value of True if the expression is false.
*=
-=
not
+
22. The keyword beginning a header that will create a loop.
for
float
str
<=
23. floor division
del
argv
read
a//b
24. Modulus operator. It's the remainder after division
//=
%
append()
print()
25. The keyword beginning a header that will create a new function.
open()
else
def
#
26. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
//=
<<
write
27. Symbol to add things together
^
break
+
and
28. inserts an item inside a list at a certain index
<
round()
floating point number
insert()
29. Modulus operator. It's the remainder after division
**=
%
len()
*truncate
30. prints its parameter to the console
print()
^
%
write
31. adds an item to a list
%
append()
else
==
32. Symbol to divide by the number to the right of the symbol
/
for
return
raise
33. Create a variable.
a**b
=
not in
class
34. 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
/=
<
<<
%s
35. Argument variable
str()
print()
argv
&
36. square root
math.sqrt(a)
insert()
not in
*write(stuff)
37. This keyword begins the simplest form of a conditional statement.
math.sqrt(a)
a//b
in
if
38. Function to write something to a file
#
and
write
for
39. This keyword in the body of a conditional - gives an alternative execution.
try
str()
=
else
40. 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
open()
int()
append()
41. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
round()
~
len()
not in
42. add AND assignment operator
+=
=
not
print
43. turns an object into an integer
>>
int()
str()
break
44. Where the parameters go. A necessary punctuation after any function even if it's empty.
//=
&
()
not
45. Reads just one line of a text file.
print
*readline
in
math.sqrt(a)
46. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
^
class
%s
|
47. Less than symbol
<<
<
>>
%d
48. Argument variable
argv
a//b
.py
=
49. Less than or equal to symbol
print
<=
del
*read
50. exponentiation
a**b
abs(a)
%s
str()