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. Prints a string to the screen which is converted using repr()
%r
is
and
>>
2. Less than or equal to symbol
<=
+
elif (Else if)
str
3. The extension for Python scripts
.py
<
==
def
4. Symbol to multiply things
*
a%b
-
del
5. reads just one line of a text file & keeps track of where in the file you're at
insert()
file.readline()
append()
=
6. prints its parameter to the console
/
a**b
:
print()
7. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
for
#
&
8. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
+=
#
%
9. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
*readline
pass
input()
|
10. Prints a string to the screen which is converted using repr()
raise
/
or
%r
11. Less than or equal to symbol
&
<=
~
=
12. Symbol to divide by the number to the right of the symbol
format string
/
insert()
*readline
13. 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.
/
%
print
in
14. modulus AND assignment operator
%=
file.readline()
>=
not
15. This keyword begins the simplest form of a conditional statement.
math.sqrt(a)
if
*write(stuff)
format string
16. Function to read the contents of a file
try
read
in
:
17. assignment operator
input()
Variables
#
=
18. Symbol to subtract things from each other
readline
^
or
-
19. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
readline
str()
len()
~
20. Greater than symbol
#
:
>
int
21. 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
=
abs(a)
^
>=
22. Greater than symbol
**=
%=
>
argv
23. multiply AND assignment operator
else
math.sqrt(a)
write
*=
24. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
floating point number
int()
%r
class
25. A logical operator which compares two operands and produces True if they are equal and False otherwise
break
()
==
truncate
26. Create a variable.
%=
=
math.sqrt(a)
.py
27. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
pass
~
^
28. Where the parameters go. A necessary punctuation after any function even if it's empty.
round()
<<
()
len()
29. Less than symbol
assignment
for
<
print
30. Function to write something to a file
-=
write
len()
<
31. 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
>>
%=
for
=
32. This keyword in the body of a conditional allows chained conditionals.
write
.py
:
elif (Else if)
33. absolute value
pass
#
abs(a)
str()
34. Command to print to the screen
try
for
print
not in
35. asks the user for a response and returns that response
def
not
input()
-=
36. Prints a string to the screen which is a signed decimal.
%d
a%b
=
floating point number
37. Reads the contents of the file you can assign the result to a variable.
*read
<
==
del
38. Create a variable.
=
%d
Variables
<
39. add AND assignment operator
class
.py
+=
and
40. A logical operator which requires two expressions to both be true.
and
/
print
%r
41. absolute value
=
abs(a)
#
file.seek()
42. Symbol to divide by the number to the right of the symbol
<
/
math.sqrt(a)
in
43. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
not in
try
round()
a%b
44. deletes an item from a list
#
|
str()
del
45. divide AND assignment operator
/=
if
**=
#
46. Adds a new line character
n
>>
**=
*readline
47. This statement causes an exception.
file.write(stuff)
close
raise
+
48. square root
>
%r
math.sqrt(a)
raise
49. writes stuff to the file
close
file.write(stuff)
<<
readline
50. An operator to check whether two variables refer to the same object.
int()
print
%s
is