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
%s
//=
a//b
<<
2. An operator to check whether two variables refer to the same object.
()
while
is
if
3. A statement that assigns a value to a variable.
int()
a%b
+
assignment
4. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
write
>=
//=
5. A logical operator which requires two expressions to both be true.
def
print
-=
and
6. Symbol to multiply things
*
<
is
file.seek()
7. assignment operator
close
=
truncate
>
8. modulus AND assignment operator
-
write
Variables
%=
9. Symbol to add things together
%
>=
+
&
10. Where the parameters go. A necessary punctuation after any function even if it's empty.
not in
file.truncate()
%d
()
11. Less than symbol
>
<
in
except
12. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
*=
^
try
<=
13. adds an item to a list
<<
and
append()
~
14. Symbol to add things together
argument variable
+
>
/=
15. square root
file.truncate()
.py
math.sqrt(a)
truncate
16. deletes an item from a list
file.truncate()
continue
and
del
17. returns the length of a string (number of characters)
append()
:
a**b
len()
18. multiply AND assignment operator
*=
str()
a//b
input()
19. Empties the file - watch out if you care about the file.
assignment
math.sqrt(a)
a%b
*truncate
20. The extension for Python scripts
/
not
.py
%
21. 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
/=
%=
|
22. A built-in function that converts integers and strings to floating-point numbers.
float
str()
except
=
23. This keyword in the body of a conditional - gives an alternative execution.
int()
round()
del
else
24. Adds something to a variable
=
%s
<<
for
25. turns an object into an integer
file.write(stuff)
argv
str
int()
26. A statement that displays a value on the screen.
format string
print
elif (Else if)
close
27. exponentiation
a%b
a**b
=
int()
28. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
%
else
or
class
29. rounds a number to the number of decimal points you choose
not in
close
else
round()
30. rounds a number to the number of decimal points you choose
not in
>
round()
/
31. reads just one line of a text file & keeps track of where in the file you're at
-
&
file.readline()
append()
32. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
abs(a)
~
.py
truncate
33. Reads the contents of the file you can assign the result to a variable.
-=
%
*=
*read
34. Modulus operator. It's the remainder after division
def
%
<=
append()
35. Function to close a file - it will not be able to be used again unless the file is opened.
del
open()
write
close
36. asks the user for a response and returns that response
**=
input()
pass
=
37. deletes an item from a list
>
=
del
^
38. A logical operator which compares two operands and produces True if they are equal and False otherwise
print
==
#
39. Greater than or equal symbol.
~
in
file.truncate()
>=
40. 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
except
not
<<
del
41. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
/
%=
=
&
42. add AND assignment operator
def
=
+=
*readline
43. Command to print to the screen
*=
del
argv
print
44. turns an object into an integer
not
int()
<<
%r
45. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.
in
read
readline
except
46. The keyword beginning a header that will create a loop.
n
format string
for
or
47. This keyword in the body of a conditional - gives an alternative execution.
a%b
write
else
.py
48. Less than or equal to symbol
print
/=
<=
write
49. 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
write
del
%d
50. A data type for representing numbers with fractional values.
floating point number
<
del
truncate