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 built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
file.seek()
math.sqrt(a)
math.sqrt(a)
2. empties the file
close
insert()
file.truncate()
%=
3. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
if
%r
try
%=
4. turns an object into an integer
is not
int()
/=
/=
5. A statement that displays a value on the screen.
assignment
math.sqrt(a)
print
floating point number
6. Greater than symbol
>
n
or
a//b
7. Prints a string to the screen which is converted using repr()
%r
//=
<
|
8. Symbol to multiply things
write
write
*
abs(a)
9. Function to empty the contents of a file - no recovery is possible
*=
truncate
int()
.py
10. Reads just one line of a text file.
%d
#
<=
*readline
11. 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
//=
abs(a)
%
>>
12. divide AND assignment operator
/=
del
<<
<=
13. floor division AND assignment operator
n
n
%s
//=
14. modulo
>
%s
a%b
open()
15. modulus AND assignment operator
abs(a)
for
%=
+=
16. Function to close a file - it will not be able to be used again unless the file is opened.
not in
elif (Else if)
and
close
17. floor division
argv
.py
del
a//b
18. floor division AND assignment operator
//=
class
%d
math.sqrt(a)
19. An operator to check whether two variables refer to the same object.
//=
try
is
read
20. Empties the file - watch out if you care about the file.
raise
|
for
*truncate
21. A logical operator which negates an expression so that it returns a value of True if the expression is false.
read
==
not
/
22. Symbol to add things together
+
#
file.write(stuff)
del
23. absolute value
abs(a)
len()
<=
not in
24. Prints a string to the screen which will be Unicode.
print
-
|
%s
25. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
del
&
:
|
26. deletes an item from a list
del
file.write(stuff)
close
#
27. turns an object into a string
math.sqrt(a)
return
str()
-
28. Prevents a runtime error from stopping the program.
except
%r
read
class
29. A logical operator which returns a value of True if either of the conditions is true.
close
str()
or
abs(a)
30. An operator that removes a value from a list.
<
abs(a)
readline
del
31. absolute value
abs(a)
readline
()
%
32. deletes an item from a list
del
or
close
*readline
33. This statement exits a function. The remaining lines of the function are not executed.
=
=
-
return
34. multiply AND assignment operator
int()
>>
*=
<=
35. reads just one line of a text file & keeps track of where in the file you're at
%s
**=
file.readline()
.py
36. asks the user for a response and returns that response
-
input()
file.write(stuff)
while
37. 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.
.py
not in
#
*=
38. Less than or equal to symbol
argv
a//b
Variables
<=
39. floor division
a//b
//=
=
a**b
40. ,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.
round()
*=
a**b
41. sets the file's current position
>>
abs(a)
file.seek()
*write(stuff)
42. A built-in function that converts its argument to a string.
del
~
insert()
str
43. Turns a line into a comment instead of executable code.
>
#
else
-
44. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
and
#
Variables
>=
45. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.
=
*=
file.readline()
in
46. This keyword in the body of a conditional - gives an alternative execution.
else
not in
*=
a%b
47. This keyword begins the simplest form of a conditional statement.
//=
round()
argv
if
48. The extension for Python scripts
.py
is not
/=
+
49. Argument variable
%d
<
argv
/=
50. turns an object into an integer
in
-
append()
int()