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. Writes stuff to the file.
*write(stuff)
-
#
2. This keyword in the body of a conditional allows chained conditionals.
<
<
elif (Else if)
str()
3. inserts an item inside a list at a certain index
>
#
insert()
>=
4. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
/=
#
else
5. Less than or equal to symbol
n
<=
for
insert()
6. Symbol to subtract things from each other
n
read
-
if
7. Symbol used to create comments
%=
:
^
#
8. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
argument variable
-=
a//b
9. The extension for Python scripts
==
str()
.py
read
10. Prevents a runtime error from stopping the program.
write
%=
.py
except
11. Prints a string to the screen which is converted using repr()
%r
^
while
readline
12. 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
>>
not
%=
abs(a)
13. Prints a string to the screen which will be Unicode.
:
%s
len()
read
14. rounds a number to the number of decimal points you choose
>=
round()
/
append()
15. add AND assignment operator
%s
argument variable
+=
>>
16. A logical operator which returns a value of True if either of the conditions is true.
+=
or
len()
return
17. subtract AND assignment operator
<
floating point number
-=
Variables
18. End header line.
=
#
argv
:
19. Function to close a file - it will not be able to be used again unless the file is opened.
a**b
close
~
round()
20. Command to print to the screen
print
=
def
n
21. exponent AND assignment operator
not in
<=
a//b
**=
22. Symbol used to create comments
is not
def
=
#
23. Symbol to multiply things
truncate
*
and
>
24. Symbol to divide by the number to the right of the symbol
/
=
read
%=
25. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
>=
class
argv
str()
26. 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
*=
read
27. The extension for Python scripts
/
.py
math.sqrt(a)
close
28. 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
&
^
-=
is
29. Adds something to a variable
*=
=
%=
write
30. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
is
/=
in
+=
31. modulo
def
argument variable
a%b
abs(a)
32. Adds a new line character
%
#
n
=
33. turns an object into an integer
file.truncate()
write
int()
<
34. Less than symbol
<
str
%
not
35. multiply AND assignment operator
:
*=
<=
*
36. Function to empty the contents of a file - no recovery is possible
format string
truncate
=
%
37. Modulus operator. It's the remainder after division
a//b
%
-
.py
38. add AND assignment operator
+=
~
~
/=
39. modulus AND assignment operator
a%b
%=
-=
print()
40. A logical operator which requires two expressions to both be true.
and
not in
write
len()
41. rounds a number to the number of decimal points you choose
round()
math.sqrt(a)
file.readline()
42. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
print
a**b
<
43. The keyword beginning a header that will create a loop.
open()
for
>
+
44. turns an object into a string
str()
not in
len()
insert()
45. A logical operator which compares two operands and produces True if they are equal and False otherwise
for
%d
close
==
46. empties the file
>>
file.truncate()
continue
#
47. Greater than or equal symbol.
n
raise
*
>=
48. floor division AND assignment operator
n
readline
//=
>>
49. square root
del
*truncate
math.sqrt(a)
a//b
50. prints its parameter to the console
^
*=
<<
print()