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. Less than symbol
<
%
~
-=
2. Command to print to the screen
file.write(stuff)
write
print
len()
3. Function to open or read a file
()
n
argv
open()
4. This statement exits a function. The remaining lines of the function are not executed.
<<
return
&
%
5. A built-in function that converts its argument to a string.
str
:
*
6. Symbol used to create comments
and
#
truncate
del
7. Function to read the contents of a file
math.sqrt(a)
print
read
argv
8. Adds something to a variable
abs(a)
for
=
len()
9. The keyword beginning a header that will create a new function.
^
def
in
%d
10. Less than or equal to symbol
<=
try
^
=
11. A keyword that does nothing but fill space to indicate code which will be written later.
pass
>=
and
&
12. sets the file's current position
print()
<<
str()
file.seek()
13. Function to close a file - it will not be able to be used again unless the file is opened.
close
readline
-
return
14. A logical operator which compares two operands and produces True if they are equal and False otherwise
not
is
|
==
15. Function to empty the contents of a file - no recovery is possible
input()
truncate
print()
return
16. A statement that displays a value on the screen.
Variables
len()
round()
print
17. 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).
#
and
is not
for
18. This keyword in the body of a conditional - gives an alternative execution.
#
else
raise
*read
19. A logical operator which requires two expressions to both be true.
and
int
<<
Variables
20. single line comment
#
if
open()
-
21. Symbol to add things together
:
abs(a)
*write(stuff)
+
22. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
<=
n
*=
class
23. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
argv
%
#
24. square root
not in
len()
math.sqrt(a)
=
25. add AND assignment operator
+=
%
write
%s
26. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
append()
floating point number
&
27. A statement that ends the current iteration of a loop but continues looping.
else
>>
continue
**=
28. floor division
a//b
%r
in
+=
29. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
n
Variables
>>
close
30. inserts an item inside a list at a certain index
=
str()
while
insert()
31. Writes stuff to the file.
=
:
float
*write(stuff)
32. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
del
len()
del
33. 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
del
^
file.seek()
a%b
34. This keyword begins the simplest form of a conditional statement.
open()
if
|
:
35. turns an object into a string
math.sqrt(a)
str()
*truncate
()
36. returns the length of a string (number of characters)
*
def
len()
>
37. prints its parameter to the console
.py
*=
print()
read
38. Symbol to multiply things
file.write(stuff)
//=
input()
*
39. This statement causes an exception.
raise
=
+=
int()
40. Prints a string to the screen which is converted using repr()
%=
&
str()
%r
41. reads just one line of a text file & keeps track of where in the file you're at
~
file.readline()
()
file.seek()
42. turns an object into a string
str()
<=
>
/=
43. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
read
break
/=
44. Greater than symbol
print
file.write(stuff)
round()
>
45. Reads the contents of the file you can assign the result to a variable.
a%b
readline
write
*read
46. Prints a string to the screen which is a signed decimal.
:
%d
truncate
append()
47. Reads just one line of a text file.
math.sqrt(a)
#
continue
*readline
48. Prints a string to the screen which is a signed decimal.
<=
<
()
%d
49. Symbol to subtract things from each other
floating point number
readline
-
write
50. Symbol to multiply things
round()
-
close
*