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. rounds a number to the number of decimal points you choose
==
if
round()
a//b
2. returns the length of a string (number of characters)
math.sqrt(a)
else
truncate
len()
3. The keyword beginning a header that will create a loop.
for
-
int
argv
4. Prints a string to the screen which will be Unicode.
%s
while
%d
&
5. Function to close a file - it will not be able to be used again unless the file is opened.
+=
=
not
close
6. turns an object into an integer
break
int()
str()
//=
7. divide AND assignment operator
/=
*
*=
close
8. Less than symbol
a%b
=
<
-=
9. 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
insert()
-
10. absolute value
str
format string
abs(a)
del
11. A statement that displays a value on the screen.
else
abs(a)
=
print
12. add AND assignment operator
str()
and
**=
+=
13. Function to read the contents of a file
%r
-=
Variables
read
14. Adds something to a variable
=
print()
pass
for
15. assignment operator
=
~
math.sqrt(a)
del
16. exponentiation
truncate
a**b
append()
>>
17. An operator to check whether two variables refer to the same object.
is
+=
del
n
18. End header line.
==
break
int
:
19. Turns a line into a comment instead of executable code.
#
round()
*
<=
20. Empties the file - watch out if you care about the file.
append()
print
print()
*truncate
21. floor division
a//b
<
in
=
22. rounds a number to the number of decimal points you choose
>>
round()
**=
break
23. modulo
//=
#
a%b
&
24. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
del
file.truncate()
%s
25. A logical operator which compares two operands and produces True if they are equal and False otherwise
int
==
argument variable
-=
26. 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
>=
^
&
**=
27. Symbol used to create comments
#
==
insert()
int
28. This keyword begins a header for a body that repeats until the condition is no longer true.
while
if
%s
continue
29. 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
or
else
=
30. A built-in function that converts its argument to a string.
str
try
is
and
31. asks the user for a response and returns that response
else
/=
.py
input()
32. deletes an item from a list
//=
is
len()
del
33. Less than or equal to symbol
*
*readline
def
<=
34. Function to write something to a file
insert()
=
and
write
35. Symbol to add things together
read
+
/
/=
36. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
:
if
for
37. A statement that breaks out of a loop.
=
round()
class
break
38. square root
*
Variables
math.sqrt(a)
*=
39. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
:
file.readline()
=
40. This statement exits a function. The remaining lines of the function are not executed.
return
.py
input()
not in
41. Prints a string to the screen which is a signed decimal.
not
%d
-
class
42. floor division AND assignment operator
^
>=
//=
int()
43. Create a variable.
+=
%=
=
a%b
44. Function to open or read a file
open()
//=
=
&
45. A logical operator which returns a value of True if either of the conditions is true.
>=
round()
or
def
46. 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.
print
raise
argument variable
return
47. modulus AND assignment operator
|
%s
%=
%r
48. Argument variable
//=
class
a%b
argv
49. A built-in function that converts integers and strings to floating-point numbers.
float
break
and
>=
50. This keyword in the body of a conditional - gives an alternative execution.
else
and
floating point number
%