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. floor division
format string
argv
a//b
.py
2. single line comment
/
try
print
#
3. The extension for Python scripts
else
*truncate
.py
len()
4. Symbol to multiply things
=
*
.py
a//b
5. Empties the file - watch out if you care about the file.
not
float
**=
*truncate
6. floor division AND assignment operator
//=
%s
#
del
7. Prints a string to the screen which is converted using repr()
round()
#
for
%r
8. Prevents a runtime error from stopping the program.
-=
close
file.truncate()
except
9. Function to open or read a file
Variables
open()
input()
file.write(stuff)
10. 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
*read
print
==
<<
11. exponent AND assignment operator
print
file.truncate()
abs(a)
**=
12. adds an item to a list
a**b
math.sqrt(a)
n
append()
13. adds an item to a list
append()
a//b
*truncate
and
14. The keyword beginning a header that will create a new function.
def
assignment
file.truncate()
>>
15. Greater than or equal symbol.
>
>=
is not
print
16. This statement causes an exception.
*readline
=
raise
<<
17. A keyword that does nothing but fill space to indicate code which will be written later.
return
def
pass
len()
18. turns an object into a string
print()
*read
==
str()
19. assignment operator
%
append()
<=
=
20. modulus AND assignment operator
^
%=
>
%s
21. A built-in function that converts its argument to a string.
str
insert()
=
for
22. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
%s
elif (Else if)
str()
23. Greater than symbol
write
^
insert()
>
24. This keyword begins a header for a body that repeats until the condition is no longer true.
while
abs(a)
not
raise
25. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
while
for
+
26. This keyword in the body of a conditional - gives an alternative execution.
return
==
else
/
27. An operator that removes a value from a list.
truncate
%s
&
del
28. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
#
write
int()
29. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
Variables
#
del
30. Reads just one line of a text file.
<<
*readline
del
if
31. A logical operator which compares two operands and produces True if they are equal and False otherwise
()
break
==
**=
32. ,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.
#
file.write(stuff)
readline
33. Symbol to add things together
#
+
&
:
34. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
*=
argv
read
35. Turns a line into a comment instead of executable code.
#
a**b
round()
assignment
36. End header line.
*truncate
write
write
:
37. deletes an item from a list
del
truncate
argv
is
38. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
round()
+
.py
39. The keyword beginning a header that will create a loop.
readline
int
for
argv
40. A built-in function that converts integers and strings to floating-point numbers.
+
float
input()
:
41. turns an object into an integer
int()
=
file.truncate()
argv
42. 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
n
%
print
43. writes stuff to the file
n
file.write(stuff)
.py
write
44. modulo
open()
%d
a%b
del
45. deletes an item from a list
del
>=
close
insert()
46. 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
file.readline()
=
47. square root
not
=
math.sqrt(a)
int()
48. asks the user for a response and returns that response
input()
%s
read
=
49. Symbol to add things together
%d
+
*readline
>=
50. add AND assignment operator
-=
>=
return
+=