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. 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
int()
if
<<
file.truncate()
2. A logical operator which returns a value of True if either of the conditions is true.
n
input()
or
else
3. prints its parameter to the console
print()
<=
truncate
**=
4. Symbol used to create comments
pass
int
>
#
5. Argument variable
try
for
>=
argv
6. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
*truncate
n
//=
7. assignment operator
=
.py
+=
>
8. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
append()
|
del
def
9. 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.
truncate
print
argument variable
+
10. add AND assignment operator
**=
+=
read
del
11. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
class
for
a**b
12. Argument variable
continue
floating point number
argv
insert()
13. 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).
is not
-=
%r
/=
14. Symbol to multiply things
%
for
-=
*
15. rounds a number to the number of decimal points you choose
input()
else
*read
round()
16. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
while
*write(stuff)
print
17. inserts an item inside a list at a certain index
len()
insert()
~
close
18. modulus AND assignment operator
+=
not
%=
break
19. A statement that ends the current iteration of a loop but continues looping.
continue
elif (Else if)
int
else
20. add AND assignment operator
str
**=
+=
>
21. Empties the file - watch out if you care about the file.
|
*truncate
for
%d
22. Modulus operator. It's the remainder after division
class
**=
%
<
23. Symbol to add things together
//=
+
.py
for
24. asks the user for a response and returns that response
truncate
*=
%
input()
25. square root
Variables
math.sqrt(a)
+
&
26. Less than or equal to symbol
int()
<=
round()
-
27. asks the user for a response and returns that response
input()
write
pass
-=
28. Create a variable.
int
in
>=
=
29. Prints a string to the screen which is converted using repr()
>>
<<
%r
append()
30. Greater than or equal symbol.
**=
>=
()
>>
31. Less than symbol
append()
<
~
for
32. The keyword beginning a header that will create a loop.
for
format string
truncate
#
33. Function to close a file - it will not be able to be used again unless the file is opened.
|
raise
argument variable
close
34. multiply AND assignment operator
readline
%d
*=
input()
35. inserts an item inside a list at a certain index
insert()
()
*truncate
<<
36. This keyword begins the simplest form of a conditional statement.
if
float
^
a%b
37. Prints a string to the screen which is converted using repr()
print
+=
abs(a)
%r
38. Greater than symbol
.py
>
%r
&
39. modulus AND assignment operator
except
for
%=
return
40. floor division
a//b
n
%d
/
41. Function to empty the contents of a file - no recovery is possible
truncate
>>
#
str
42. The keyword beginning a header that will create a new function.
def
argv
len()
/
43. The keyword beginning a header that will create a loop.
Variables
Variables
/
for
44. ,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.
math.sqrt(a)
.py
del
45. divide AND assignment operator
int
a**b
/=
round()
46. absolute value
+=
in
abs(a)
&
47. A built-in function that converts integers and strings to floating-point numbers.
float
%=
%s
else
48. absolute value
=
#
abs(a)
in
49. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
//=
|
>
*read
50. Create a variable.
:
=
#
a%b