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. Function to open or read a file
|
int
open()
float
2. Create a variable.
<<
*truncate
=
/=
3. turns an object into an integer
Variables
not in
int()
close
4. A statement that displays a value on the screen.
**=
is not
print
5. Writes stuff to the file.
write
*write(stuff)
<=
len()
6. This statement causes an exception.
#
/=
==
raise
7. subtract AND assignment operator
assignment
-=
insert()
elif (Else if)
8. Symbol to add things together
%d
()
abs(a)
+
9. 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
read
truncate
<<
//=
10. modulo
<
a%b
**=
else
11. divide AND assignment operator
and
write
/=
+
12. sets the file's current position
|
file.seek()
file.readline()
except
13. The extension for Python scripts
a**b
%
.py
*
14. rounds a number to the number of decimal points you choose
round()
readline
def
float
15. Where the parameters go. A necessary punctuation after any function even if it's empty.
*read
()
>
floating point number
16. Function to read the contents of a file
else
<=
read
()
17. add AND assignment operator
del
+=
class
def
18. Adds something to a variable
print()
=
for
abs(a)
19. This keyword begins the simplest form of a conditional statement.
+
if
n
//=
20. Symbol to divide by the number to the right of the symbol
open()
/
.py
*=
21. Symbol to multiply things
abs(a)
pass
print
*
22. A data type for representing numbers with fractional values.
floating point number
not in
-
del
23. Prints a string to the screen which is converted using repr()
del
append()
/=
%r
24. This keyword begins the simplest form of a conditional statement.
/
break
if
print
25. Command to print to the screen
del
elif (Else if)
=
print
26. asks the user for a response and returns that response
input()
%d
%r
truncate
27. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
in
//=
**=
28. floor division
len()
^
%d
a//b
29. Modulus operator. It's the remainder after division
//=
%
while
del
30. This statement exits a function. The remaining lines of the function are not executed.
print()
close
return
float
31. square root
%=
math.sqrt(a)
argv
Variables
32. Empties the file - watch out if you care about the file.
*truncate
#
%
file.seek()
33. Create a variable.
=
floating point number
float
**=
34. An operator that removes a value from a list.
del
argument variable
else
/
35. Less than or equal to symbol
>>
<=
>
continue
36. An operator to check whether two variables refer to the same object.
>
del
is
>=
37. Function to empty the contents of a file - no recovery is possible
not
-=
*read
truncate
38. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
print
*
|
+
39. A logical operator which requires two expressions to both be true.
try
=
<=
and
40. This keyword in the body of a conditional - gives an alternative execution.
else
<
str
file.readline()
41. 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.
*read
n
*
argument variable
42. Symbol to subtract things from each other
input()
and
input()
-
43. A built-in function that converts its argument to a string.
>=
n
str
*=
44. The keyword beginning a header that will create a loop.
^
for
:
append()
45. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
print()
del
&
close
46. returns the length of a string (number of characters)
argument variable
len()
%
**=
47. deletes an item from a list
int()
%d
del
is not
48. 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
int()
>>
()
abs(a)
49. assignment operator
=
round()
readline
print
50. add AND assignment operator
+=
%d
%
not