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. Function to close a file - it will not be able to be used again unless the file is opened.
close
else
*truncate
open()
2. The extension for Python scripts
.py
>=
*truncate
argv
3. Modulus operator. It's the remainder after division
<=
%
argv
in
4. Greater than or equal symbol.
**=
>=
>
read
5. 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.
str()
not in
len()
6. adds an item to a list
append()
file.write(stuff)
/
=
7. Adds a new line character
n
*readline
file.seek()
print()
8. floor division
>
a//b
%d
in
9. absolute value
raise
or
not in
abs(a)
10. Symbol to divide by the number to the right of the symbol
not
int()
+
/
11. subtract AND assignment operator
-=
^
insert()
continue
12. A statement that assigns a value to a variable.
insert()
#
assignment
for
13. Symbol used to create comments
or
=
#
while
14. exponent AND assignment operator
read
>
**=
=
15. Command to print to the screen
else
read
%
print
16. The keyword beginning a header that will create a new function.
return
def
not in
//=
17. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
while
readline
try
pass
18. unction to read one line of a file
**=
readline
<=
-=
19. A logical operator which returns a value of True if either of the conditions is true.
or
input()
>>
()
20. writes stuff to the file
floating point number
input()
is not
file.write(stuff)
21. A keyword that does nothing but fill space to indicate code which will be written later.
print
pass
format string
*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).
math.sqrt(a)
is not
:
*=
23. Less than or equal to symbol
def
=
%r
<=
24. The extension for Python scripts
+
.py
round()
*readline
25. exponent AND assignment operator
**=
print
:
is
26. Function to read the contents of a file
int()
read
-=
a**b
27. This statement exits a function. The remaining lines of the function are not executed.
*readline
str()
return
<
28. This keyword begins a header for a body that repeats until the condition is no longer true.
while
<<
insert()
readline
29. Adds a new line character
file.write(stuff)
n
raise
a//b
30. Symbol to add things together
*write(stuff)
pass
+
open()
31. Adds something to a variable
while
del
=
append()
32. The keyword beginning a header that will create a loop.
is
def
del
for
33. 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
<<
()
file.readline()
print
34. unction to read one line of a file
readline
or
//=
not in
35. returns the length of a string (number of characters)
len()
=
=
%s
36. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
%=
for
continue
37. Symbol to multiply things
close
len()
*
a**b
38. This statement causes an exception.
abs(a)
float
argv
raise
39. deletes an item from a list
*
class
break
del
40. turns an object into a string
n
>
str()
%
41. Reads just one line of a text file.
&
#
~
*readline
42. Argument variable
argv
()
and
%d
43. Create a variable.
<<
truncate
=
a%b
44. returns the length of a string (number of characters)
a//b
len()
break
^
45. Function to read the contents of a file
<
%=
read
^
46. A logical operator which compares two operands and produces True if they are equal and False otherwise
try
+=
/=
==
47. A statement that breaks out of a loop.
else
#
break
readline
48. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
<<
append()
readline
in
49. A logical operator which compares two operands and produces True if they are equal and False otherwise
math.sqrt(a)
()
argv
==
50. Modulus operator. It's the remainder after division
append()
def
%
abs(a)