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. Greater than symbol
>
+=
abs(a)
while
2. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
a**b
in
/=
//=
3. asks the user for a response and returns that response
input()
*=
Variables
%=
4. 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
while
%
^
a//b
5. floor division
|
a**b
assignment
a//b
6. Argument variable
file.write(stuff)
argv
input()
-=
7. Less than symbol
#
<
*read
not in
8. ,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.
return
append()
class
9. rounds a number to the number of decimal points you choose
round()
pass
~
**=
10. Turns a line into a comment instead of executable code.
|
#
//=
*read
11. exponent AND assignment operator
/
continue
#
**=
12. An operator to check whether two variables refer to the same object.
<
file.seek()
is
Variables
13. A statement that ends the current iteration of a loop but continues looping.
for
del
continue
round()
14. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
is not
print
input()
15. exponentiation
del
-=
a**b
~
16. 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
//=
int
*
>>
17. empties the file
=
file.truncate()
<<
+=
18. This keyword in the body of a conditional - gives an alternative execution.
&
else
*
int
19. deletes an item from a list
int
=
del
class
20. 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.
file.write(stuff)
#
~
argument variable
21. A logical operator which compares two operands and produces True if they are equal and False otherwise
-=
#
==
readline
22. Function to open or read a file
open()
()
**=
<<
23. This keyword in the body of a conditional - gives an alternative execution.
for
def
argv
else
24. End header line.
~
:
format string
Variables
25. Symbol to multiply things
<
*
n
write
26. returns the length of a string (number of characters)
len()
print
floating point number
abs(a)
27. An operator that removes a value from a list.
<
del
math.sqrt(a)
file.truncate()
28. single line comment
#
%d
*=
str()
29. Prints a string to the screen which will be Unicode.
%s
not
*=
except
30. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
float
write
is
~
31. floor division AND assignment operator
try
and
math.sqrt(a)
//=
32. Argument variable
Variables
write
a**b
argv
33. Function to close a file - it will not be able to be used again unless the file is opened.
%=
+=
close
==
34. This keyword begins the simplest form of a conditional statement.
.py
if
a%b
is not
35. Symbol to divide by the number to the right of the symbol
/
file.write(stuff)
*
format string
36. adds an item to a list
del
class
append()
=
37. modulo
a**b
*readline
a%b
append()
38. divide AND assignment operator
float
n
~
/=
39. 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
elif (Else if)
try
//=
40. square root
math.sqrt(a)
append()
>
abs(a)
41. The extension for Python scripts
()
for
%r
.py
42. Symbol to add things together
readline
+
readline
in
43. The keyword beginning a header that will create a new function.
&
def
read
<
44. subtract AND assignment operator
<<
continue
-=
append()
45. Reads just one line of a text file.
not in
*readline
<=
-=
46. Function to read the contents of a file
read
^
=
close
47. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
//=
#
~
48. This keyword begins a header for a body that repeats until the condition is no longer true.
while
<=
except
^
49. Symbol to add things together
+
del
n
<=
50. exponentiation
except
-=
a**b
print