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. This statement exits a function. The remaining lines of the function are not executed.
insert()
return
str()
else
2. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
del
for
continue
format string
3. A keyword that does nothing but fill space to indicate code which will be written later.
truncate
pass
argv
/=
4. Modulus operator. It's the remainder after division
-=
%
*read
-=
5. writes stuff to the file
format string
if
file.write(stuff)
if
6. add AND assignment operator
+=
abs(a)
assignment
==
7. End header line.
if
=
print
:
8. A statement that ends the current iteration of a loop but continues looping.
continue
%d
argv
pass
9. 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).
%
a**b
-=
is not
10. This keyword begins a header for a body that repeats until the condition is no longer true.
>
+=
while
<=
11. A statement that breaks out of a loop.
break
truncate
/=
=
12. Greater than symbol
print()
~
>
()
13. divide AND assignment operator
/=
%s
append()
*
14. asks the user for a response and returns that response
#
input()
file.seek()
=
15. 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
truncate
int()
%
>>
16. Prevents a runtime error from stopping the program.
%
file.truncate()
except
math.sqrt(a)
17. 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
#
in
^
print()
18. Function to empty the contents of a file - no recovery is possible
print
**=
truncate
<
19. Greater than or equal symbol.
int()
>=
open()
*readline
20. modulus AND assignment operator
#
int()
%=
Variables
21. Reads the contents of the file you can assign the result to a variable.
*read
close
else
*truncate
22. Symbol used to create comments
%s
#
=
*truncate
23. assignment operator
=
while
not in
+=
24. A logical operator which requires two expressions to both be true.
//=
in
argv
and
25. Prints a string to the screen which is a signed decimal.
.py
input()
%d
=
26. square root
math.sqrt(a)
.py
=
else
27. Greater than or equal symbol.
input()
>=
Variables
str
28. Function to close a file - it will not be able to be used again unless the file is opened.
close
del
def
if
29. An operator to check whether two variables refer to the same object.
#
+=
and
is
30. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
:
return
-
31. Command to print to the screen
file.truncate()
%=
>>
print
32. This keyword in the body of a conditional - gives an alternative execution.
not in
else
file.write(stuff)
n
33. Function to read the contents of a file
int()
and
read
|
34. This keyword begins the simplest form of a conditional statement.
>>
if
+
round()
35. floor division
*
floating point number
a//b
=
36. A built-in function that converts its argument to a string.
str
-
close
%s
37. 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
-=
<<
%d
input()
38. adds an item to a list
%d
append()
not
/
39. prints its parameter to the console
readline
.py
int
print()
40. Adds something to a variable
>
>
=
*=
41. divide AND assignment operator
*readline
/=
/
for
42. floor division
/=
**=
*=
a//b
43. absolute value
abs(a)
continue
write
argument variable
44. Function to read the contents of a file
|
read
%
try
45. turns an object into an integer
for
int()
|
except
46. This keyword in the body of a conditional - gives an alternative execution.
*readline
=
argument variable
else
47. add AND assignment operator
truncate
argv
del
+=
48. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
file.truncate()
%d
%
&
49. modulo
>>
-
a%b
readline
50. A statement that assigns a value to a variable.
()
del
*readline
assignment