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. Less than or equal to symbol
<
<=
+=
~
2. Function to open or read a file
#
open()
n
class
3. inserts an item inside a list at a certain index
:
insert()
a//b
>>
4. A statement that assigns a value to a variable.
==
abs(a)
pass
assignment
5. rounds a number to the number of decimal points you choose
#
append()
round()
>>
6. Prints a string to the screen which will be Unicode.
def
>>
%s
input()
7. Symbol used to create comments
**=
open()
a%b
#
8. Adds something to a variable
=
print
#
int
9. End header line.
=
round()
del
:
10. exponent AND assignment operator
file.write(stuff)
**=
str
<=
11. prints its parameter to the console
print()
=
*readline
str()
12. turns an object into a string
<<
str()
=
<
13. unction to read one line of a file
%d
readline
abs(a)
-
14. 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
%=
for
int()
15. Function to empty the contents of a file - no recovery is possible
~
truncate
while
/=
16. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
open()
~
int()
^
17. A logical operator which requires two expressions to both be true.
and
*
assignment
in
18. floor division
#
>=
<=
a//b
19. This statement exits a function. The remaining lines of the function are not executed.
return
>>
def
for
20. Function to write something to a file
write
>
<
%s
21. Symbol to add things together
|
+
or
*
22. Symbol to divide by the number to the right of the symbol
:
if
>
/
23. Turns a line into a comment instead of executable code.
>
argument variable
#
*truncate
24. exponentiation
a**b
|
/
continue
25. Symbol to divide by the number to the right of the symbol
/
int()
-=
^
26. modulo
/=
~
a%b
a**b
27. square root
math.sqrt(a)
-
//=
28. Prints a string to the screen which is converted using repr()
a%b
%r
<<
int
29. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
<<
+
=
30. Symbol to multiply things
*
in
+
read
31. reads just one line of a text file & keeps track of where in the file you're at
<=
while
file.readline()
round()
32. floor division
a//b
or
n
def
33. Symbol used to create comments
-
#
a**b
is
34. Argument variable
argv
read
.py
readline
35. add AND assignment operator
*truncate
<
+=
in
36. 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
not
is not
^
round()
37. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
argv
|
()
class
38. multiply AND assignment operator
*read
>>
*=
append()
39. Command to print to the screen
-
if
print
read
40. adds an item to a list
int()
round()
append()
try
41. turns an object into an integer
<=
.py
int()
>
42. Adds something to a variable
=
print
a**b
open()
43. divide AND assignment operator
not in
continue
/=
open()
44. asks the user for a response and returns that response
else
<
input()
break
45. End header line.
open()
or
float
:
46. Where the parameters go. A necessary punctuation after any function even if it's empty.
int()
()
a%b
%d
47. This keyword in the body of a conditional - gives an alternative execution.
a**b
#
else
>>
48. empties the file
=
()
file.truncate()
argument variable
49. A built-in function that converts its argument to a string.
not
str
=
if
50. 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
>=
<=
^