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 string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
-=
format string
+=
2. empties the file
>
math.sqrt(a)
.py
file.truncate()
3. add AND assignment operator
+=
=
=
==
4. An operator that removes a value from a list.
print
.py
del
&
5. Adds a new line character
:
insert()
%r
n
6. 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
>>
read
*readline
read
7. This keyword in the body of a conditional - gives an alternative execution.
%
*=
else
a%b
8. Greater than or equal symbol.
while
argv
#
>=
9. Function to read the contents of a file
read
/
<<
=
10. absolute value
abs(a)
.py
print()
%=
11. This keyword begins a header for a body that repeats until the condition is no longer true.
while
>
**=
close
12. square root
.py
:
n
math.sqrt(a)
13. subtract AND assignment operator
-=
floating point number
n
=
14. exponentiation
append()
a**b
<=
print()
15. A keyword that does nothing but fill space to indicate code which will be written later.
*readline
pass
()
print
16. Greater than symbol
argv
else
%=
>
17. Adds something to a variable
=
if
*=
*=
18. 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
close
n
19. The extension for Python scripts
>>
.py
#
<<
20. square root
~
math.sqrt(a)
()
not
21. Prints a string to the screen which is converted using repr()
**=
//=
%=
%r
22. Function to write something to a file
write
file.write(stuff)
+=
print
23. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
open()
~
a%b
try
24. 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
float
<<
n
file.write(stuff)
25. inserts an item inside a list at a certain index
file.seek()
#
insert()
close
26. Modulus operator. It's the remainder after division
%
len()
continue
while
27. asks the user for a response and returns that response
input()
>
file.truncate()
write
28. unction to read one line of a file
=
readline
in
math.sqrt(a)
29. exponentiation
math.sqrt(a)
write
a**b
except
30. Less than or equal to symbol
#
<=
>
=
31. ,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.
del
round()
*
32. prints its parameter to the console
elif (Else if)
print()
*=
>
33. Symbol used to create comments
-
input()
#
truncate
34. Symbol used to create comments
append()
class
#
/
35. modulus AND assignment operator
floating point number
%=
%d
if
36. Prints a string to the screen which will be Unicode.
file.truncate()
=
a**b
%s
37. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
else
try
*
open()
38. A data type for representing numbers with fractional values.
abs(a)
readline
:
floating point number
39. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
*write(stuff)
n
del
40. returns the length of a string (number of characters)
len()
if
round()
+=
41. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
:
int
print
and
42. Prevents a runtime error from stopping the program.
truncate
==
**=
except
43. Argument variable
^
<
+=
argv
44. Adds something to a variable
is not
=
>
del
45. modulo
round()
if
+=
a%b
46. Less than symbol
()
+=
<
47. Where the parameters go. A necessary punctuation after any function even if it's empty.
~
<
()
except
48. rounds a number to the number of decimal points you choose
~
round()
#
%
49. The extension for Python scripts
for
%d
print
.py
50. floor division AND assignment operator
insert()
write
//=
%r