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. modulo
a%b
()
except
>>
2. floor division AND assignment operator
/=
print
//=
argv
3. 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.
-=
~
floating point number
argument variable
4. Symbol used to create comments
print
#
Variables
5. Symbol used to create comments
open()
*
a//b
#
6. Function to open or read a file
close
=
open()
truncate
7. 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
str()
|
>>
=
8. adds an item to a list
**=
is
append()
try
9. square root
len()
del
n
math.sqrt(a)
10. sets the file's current position
=
<=
file.seek()
class
11. prints its parameter to the console
print()
and
or
del
12. Prints a string to the screen which is a signed decimal.
*read
math.sqrt(a)
class
%d
13. A statement that breaks out of a loop.
*
break
floating point number
open()
14. End header line.
%
//=
argument variable
:
15. Greater than or equal symbol.
=
>=
=
*readline
16. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
else
*=
append()
in
17. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
in
int
-=
readline
18. 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
in
read
%d
>>
19. modulus AND assignment operator
int
a**b
math.sqrt(a)
%=
20. single line comment
#
a**b
a//b
%=
21. A logical operator which returns a value of True if either of the conditions is true.
*read
read
or
Variables
22. Function to close a file - it will not be able to be used again unless the file is opened.
close
=
<<
else
23. A statement that ends the current iteration of a loop but continues looping.
continue
<
==
read
24. A logical operator which negates an expression so that it returns a value of True if the expression is false.
~
not
.py
a%b
25. inserts an item inside a list at a certain index
insert()
**=
^
append()
26. 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
*truncate
a%b
#
^
27. prints its parameter to the console
*
>
print()
=
28. A statement that assigns a value to a variable.
+=
=
assignment
%s
29. 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).
len()
math.sqrt(a)
is not
abs(a)
30. Adds a new line character
~
//=
&
n
31. writes stuff to the file
file.write(stuff)
else
print()
in
32. End header line.
:
or
=
close
33. divide AND assignment operator
Variables
read
insert()
/=
34. asks the user for a response and returns that response
/
append()
open()
input()
35. An operator that removes a value from a list.
%d
continue
/=
del
36. The keyword beginning a header that will create a loop.
for
truncate
#
^
37. 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.
*truncate
argument variable
==
not in
38. Where the parameters go. A necessary punctuation after any function even if it's empty.
argv
()
abs(a)
a//b
39. Function to open or read a file
abs(a)
&
open()
is not
40. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
<=
&
//=
round()
41. A keyword that does nothing but fill space to indicate code which will be written later.
~
pass
a//b
*
42. A built-in function that converts integers and strings to floating-point numbers.
.py
raise
n
float
43. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
|
try
str()
.py
44. Greater than symbol
=
floating point number
file.truncate()
>
45. multiply AND assignment operator
a//b
str
del
*=
46. multiply AND assignment operator
*read
n
*write(stuff)
*=
47. Command to print to the screen
<=
%
print
a**b
48. Symbol to multiply things
<
*
def
round()
49. A logical operator which requires two expressions to both be true.
try
//=
and
read
50. Symbol to divide by the number to the right of the symbol
#
/
a**b
==