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.
del
=
not in
*read
2. subtract AND assignment operator
append()
-=
a%b
argv
3. Prints a string to the screen which is converted using repr()
and
%r
insert()
/
4. Command to print to the screen
//=
>>
elif (Else if)
print
5. The extension for Python scripts
.py
print
else
for
6. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
abs(a)
+=
int
#
7. 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
*=
format string
*truncate
8. Function to write something to a file
class
len()
|
write
9. divide AND assignment operator
int()
math.sqrt(a)
/=
>=
10. Argument variable
*
close
argv
float
11. absolute value
=
and
&
abs(a)
12. returns the length of a string (number of characters)
len()
try
-
*
13. Argument variable
argv
==
raise
is
14. 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.
else
Variables
<=
in
15. empties the file
a**b
file.truncate()
elif (Else if)
assignment
16. A built-in function that converts integers and strings to floating-point numbers.
floating point number
float
#
+=
17. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
|
*write(stuff)
()
18. Create a variable.
input()
~
in
=
19. Prints a string to the screen which is a signed decimal.
%d
%r
def
except
20. Function to close a file - it will not be able to be used again unless the file is opened.
int()
()
round()
close
21. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
abs(a)
print()
//=
and
22. This statement exits a function. The remaining lines of the function are not executed.
math.sqrt(a)
a%b
raise
return
23. turns an object into an integer
<=
int()
:
%
24. Adds something to a variable
>=
write
=
write
25. multiply AND assignment operator
argument variable
print
Variables
*=
26. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
def
&
readline
|
27. adds an item to a list
>=
*
append()
raise
28. absolute value
str()
n
abs(a)
write
29. Function to open or read a file
<<
open()
input()
*=
30. Function to write something to a file
write
open()
//=
:
31. Turns a line into a comment instead of executable code.
floating point number
%
argv
#
32. This keyword begins the simplest form of a conditional statement.
if
pass
in
del
33. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
and
%
-
34. add AND assignment operator
>
+=
Variables
Variables
35. A keyword that does nothing but fill space to indicate code which will be written later.
except
pass
-=
write
36. deletes an item from a list
/
del
Variables
write
37. Empties the file - watch out if you care about the file.
>
>=
*truncate
38. Function to empty the contents of a file - no recovery is possible
print
truncate
class
+
39. Modulus operator. It's the remainder after division
%
read
>>
+
40. A statement that assigns a value to a variable.
append()
assignment
#
str
41. The keyword beginning a header that will create a new function.
+=
def
continue
/
42. prints its parameter to the console
-
/
print()
#
43. deletes an item from a list
int()
~
del
format string
44. Greater than or equal symbol.
*
return
else
>=
45. prints its parameter to the console
read
print()
a**b
append()
46. Prints a string to the screen which will be Unicode.
%=
append()
%s
.py
47. An operator to check whether two variables refer to the same object.
while
return
is
a//b
48. Less than or equal to symbol
<=
=
n
#
49. Function to open or read a file
int
a//b
if
open()
50. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
/=
open()
if