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. unction to read one line of a file
print
break
argument variable
readline
2. deletes an item from a list
del
%s
file.readline()
#
3. divide AND assignment operator
open()
argument variable
/=
*=
4. absolute value
<
|
abs(a)
()
5. turns an object into an integer
*=
int()
a//b
for
6. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
def
&
~
try
7. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
+=
=
>>
8. empties the file
read
len()
file.truncate()
for
9. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
n
append()
in
10. Function to close a file - it will not be able to be used again unless the file is opened.
close
print()
%r
in
11. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
except
<=
n
12. Symbol to divide by the number to the right of the symbol
/
%d
a**b
insert()
13. This keyword in the body of a conditional - gives an alternative execution.
while
else
-=
14. Argument variable
int()
argv
is not
%=
15. Prevents a runtime error from stopping the program.
except
+=
print()
=
16. assignment operator
%d
=
Variables
print()
17. deletes an item from a list
print
del
try
if
18. Function to open or read a file
Variables
try
#
open()
19. Modulus operator. It's the remainder after division
%
#
str()
n
20. End header line.
:
for
class
del
21. 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
input()
a**b
read
^
22. prints its parameter to the console
if
print
+=
print()
23. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
int()
truncate
round()
24. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.
|
argument variable
str
+=
25. inserts an item inside a list at a certain index
append()
raise
insert()
round()
26. Modulus operator. It's the remainder after division
%
insert()
**=
int()
27. ,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.
for
write
*write(stuff)
28. A built-in function that converts integers and strings to floating-point numbers.
and
>=
<
float
29. modulo
a%b
-
%s
else
30. Symbol to multiply things
or
insert()
*
>
31. subtract AND assignment operator
file.seek()
:
-=
else
32. Prints a string to the screen which is converted using repr()
%r
()
>>
close
33. add AND assignment operator
+=
*write(stuff)
break
open()
34. Reads just one line of a text file.
>>
*readline
+=
is not
35. Adds something to a variable
write
//=
=
print
36. adds an item to a list
a**b
append()
str
#
37. Argument variable
truncate
argv
close
Variables
38. Symbol to add things together
+
print
-
input()
39. multiply AND assignment operator
len()
is not
insert()
*=
40. rounds a number to the number of decimal points you choose
/=
>
round()
insert()
41. The keyword beginning a header that will create a loop.
for
str
=
<
42. A data type for representing numbers with fractional values.
else
floating point number
len()
for
43. writes stuff to the file
def
file.write(stuff)
+=
#
44. The extension for Python scripts
=
-
<=
.py
45. This keyword begins the simplest form of a conditional statement.
if
<=
/=
%s
46. Symbol to subtract things from each other
a%b
truncate
-
except
47. Adds a new line character
while
Variables
n
+
48. divide AND assignment operator
read
format string
/=
print()
49. Symbol used to create comments
#
/
==
and
50. Function to empty the contents of a file - no recovery is possible
=
-
print
truncate