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. A logical operator which returns a value of True if either of the conditions is true.
~
float
or
write
2. Prints a string to the screen which is a signed decimal.
>=
=
%d
<=
3. Reads just one line of a text file.
.py
*readline
|
and
4. 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.
not in
:
-=
#
5. empties the file
-
in
else
file.truncate()
6. Symbol to multiply things
del
*
for
*=
7. A statement that displays a value on the screen.
close
print
while
open()
8. Symbol to divide by the number to the right of the symbol
/
if
a**b
float
9. Modulus operator. It's the remainder after division
open()
%
%=
a**b
10. Writes stuff to the file.
*write(stuff)
Variables
abs(a)
()
11. The keyword beginning a header that will create a loop.
%d
input()
int()
for
12. returns the length of a string (number of characters)
file.seek()
insert()
len()
%
13. The keyword beginning a header that will create a new function.
round()
def
#
open()
14. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
abs(a)
try
while
file.readline()
15. unction to read one line of a file
write
+
readline
try
16. floor division AND assignment operator
//=
/=
pass
print()
17. prints its parameter to the console
print()
:
argument variable
n
18. Less than symbol
+=
%
<
%d
19. divide AND assignment operator
/=
>
in
format string
20. The extension for Python scripts
in
int()
.py
try
21. modulo
*read
%
a%b
=
22. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
/=
<
close
23. unction to read one line of a file
while
readline
a//b
input()
24. A data type for representing numbers with fractional values.
+=
floating point number
^
while
25. deletes an item from a list
=
del
<<
int()
26. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
%
%r
|
<=
27. This keyword begins a header for a body that repeats until the condition is no longer true.
str
len()
while
%s
28. rounds a number to the number of decimal points you choose
:
int
or
round()
29. Create a variable.
%d
=
<=
*=
30. End header line.
int()
is not
str()
:
31. A logical operator which requires two expressions to both be true.
^
|
and
is
32. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
>
&
input()
argv
33. The keyword beginning a header that will create a loop.
print
~
try
for
34. Less than symbol
<
*readline
append()
|
35. 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
and
close
write
<<
36. Function to close a file - it will not be able to be used again unless the file is opened.
else
close
*readline
:
37. modulo
len()
float
in
a%b
38. This statement causes an exception.
math.sqrt(a)
>
file.truncate()
raise
39. assignment operator
/
=
>>
>>
40. A built-in function that converts integers and strings to floating-point numbers.
truncate
#
a%b
float
41. Create a variable.
#
argv
=
+
42. 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
+
^
str
math.sqrt(a)
43. Function to open or read a file
close
>>
^
open()
44. Greater than or equal symbol.
is
>=
except
file.readline()
45. exponent AND assignment operator
%=
**=
print()
==
46. modulus AND assignment operator
%=
==
<=
-=
47. 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
read
except
//=
>>
48. multiply AND assignment operator
continue
int
*=
/=
49. 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
read
^
+
for
50. turns an object into a string
a%b
write
+
str()