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. Symbol used to create comments
*readline
#
open()
str
2. 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.
*truncate
input()
argument variable
Variables
3. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
a%b
append()
>=
4. The keyword beginning a header that will create a new function.
assignment
del
int()
def
5. Argument variable
%s
read
argv
abs(a)
6. absolute value
>>
abs(a)
()
>>
7. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
append()
int
truncate
//=
8. add AND assignment operator
raise
in
floating point number
+=
9. divide AND assignment operator
a**b
/=
-
abs(a)
10. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
%d
~
insert()
math.sqrt(a)
11. multiply AND assignment operator
<=
*=
==
readline
12. asks the user for a response and returns that response
input()
()
del
%d
13. prints its parameter to the console
print()
|
>
open()
14. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000
<<
readline
input()
>>
15. Less than symbol
+=
print()
<
input()
16. modulo
truncate
file.seek()
a%b
=
17. Function to write something to a file
**=
write
%d
print()
18. subtract AND assignment operator
-
-=
^
<=
19. modulus AND assignment operator
/=
len()
input()
%=
20. Symbol to divide by the number to the right of the symbol
a//b
write
>=
/
21. sets the file's current position
print()
file.seek()
else
=
22. Symbol to subtract things from each other
-
=
n
-=
23. The keyword beginning a header that will create a new function.
==
%d
%s
def
24. Adds a new line character
n
def
a%b
%d
25. A built-in function that converts integers and strings to floating-point numbers.
floating point number
/=
float
=
26. A statement that assigns a value to a variable.
read
==
assignment
:
27. returns the length of a string (number of characters)
>>
del
for
len()
28. single line comment
readline
#
.py
float
29. rounds a number to the number of decimal points you choose
len()
round()
close
-
30. modulo
<
write
<=
a%b
31. multiply AND assignment operator
read
abs(a)
pass
*=
32. Function to read the contents of a file
+
*=
argv
read
33. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000
file.truncate()
<
%=
<<
34. The extension for Python scripts
+
.py
floating point number
print()
35. deletes an item from a list
del
read
<<
read
36. inserts an item inside a list at a certain index
<=
insert()
else
#
37. ,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.
-=
read
.py
38. Function to write something to a file
for
read
round()
write
39. empties the file
^
float
file.truncate()
~
40. This statement causes an exception.
open()
=
raise
in
41. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
is not
class
print
argv
42. Less than or equal to symbol
pass
open()
<=
/=
43. assignment operator
*truncate
=
#
//=
44. Symbol to multiply things
def
%d
*
in
45. modulus AND assignment operator
not in
int()
%=
input()
46. A statement that ends the current iteration of a loop but continues looping.
/
^
str()
continue
47. This keyword begins a header for a body that repeats until the condition is no longer true.
/
int()
file.seek()
while
48. 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.
&
>
in
*truncate
49. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
abs(a)
not in
floating point number
50. Prevents a runtime error from stopping the program.
except
/=
write
.py