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. 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.
str()
elif (Else if)
not in
*write(stuff)
2. turns an object into an integer
<<
#
open()
int()
3. 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
&
print
4. absolute value
close
file.truncate()
*=
abs(a)
5. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
def
int()
a%b
6. modulo
raise
a%b
*
>>
7. Where the parameters go. A necessary punctuation after any function even if it's empty.
=
del
()
return
8. Prints a string to the screen which is converted using repr()
except
%r
~
len()
9. exponent AND assignment operator
input()
#
float
**=
10. turns an object into a string
del
insert()
str()
=
11. floor division
/=
readline
round()
a//b
12. This keyword begins a header for a body that repeats until the condition is no longer true.
.py
==
print()
while
13. Symbol used to create comments
write
truncate
#
a//b
14. deletes an item from a list
del
*write(stuff)
append()
def
15. square root
>>
math.sqrt(a)
#
close
16. Less than symbol
**=
<=
if
<
17. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
input()
readline
format string
n
18. Greater than symbol
format string
-
>
str()
19. Function to open or read a file
file.write(stuff)
open()
a**b
20. square root
math.sqrt(a)
is not
()
for
21. Prints a string to the screen which is a signed decimal.
%d
>=
input()
read
22. returns the length of a string (number of characters)
except
%s
insert()
len()
23. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
append()
insert()
is
class
24. An operator to check whether two variables refer to the same object.
Variables
is
argv
-
25. A statement that displays a value on the screen.
input()
print
=
file.readline()
26. unction to read one line of a file
append()
readline
*truncate
insert()
27. rounds a number to the number of decimal points you choose
Variables
del
round()
a**b
28. A logical operator which compares two operands and produces True if they are equal and False otherwise
int
+=
else
==
29. modulus AND assignment operator
%=
floating point number
str
math.sqrt(a)
30. add AND assignment operator
print
and
+=
raise
31. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
round()
not
Variables
int()
32. 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
>>
floating point number
try
int
33. Symbol to add things together
~
*
+
>
34. 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
^
round()
return
=
35. asks the user for a response and returns that response
%s
input()
read
*=
36. adds an item to a list
else
str()
**=
append()
37. turns an object into a string
not
try
*readline
str()
38. Function to empty the contents of a file - no recovery is possible
truncate
<
*read
class
39. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
=
del
>
in
40. Turns a line into a comment instead of executable code.
#
>
pass
/
41. writes stuff to the file
/=
a%b
file.write(stuff)
write
42. Argument variable
a//b
argv
=
>
43. The extension for Python scripts
is
.py
elif (Else if)
-
44. This keyword begins the simplest form of a conditional statement.
<<
assignment
del
if
45. Symbol to add things together
-=
+
=
argv
46. assignment operator
open()
=
Variables
assignment
47. Command to print to the screen
print()
print
def
^
48. reads just one line of a text file & keeps track of where in the file you're at
*read
>
file.readline()
&
49. Create a variable.
<
def
=
format string
50. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
truncate
int()
def