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. prints its parameter to the console
print()
input()
else
-
2. assignment operator
file.truncate()
=
+
is not
3. Function to empty the contents of a file - no recovery is possible
continue
readline
truncate
#
4. multiply AND assignment operator
>>
Variables
*=
and
5. 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.
not in
str
int
math.sqrt(a)
6. Less than or equal to symbol
if
**=
n
<=
7. inserts an item inside a list at a certain index
str
>=
insert()
abs(a)
8. returns the length of a string (number of characters)
abs(a)
//=
len()
else
9. Function to close a file - it will not be able to be used again unless the file is opened.
is not
#
.py
close
10. Function to write something to a file
%
is
class
write
11. rounds a number to the number of decimal points you choose
%
round()
:
append()
12. A statement that assigns a value to a variable.
%d
raise
a**b
assignment
13. sets the file's current position
Variables
print
<=
file.seek()
14. Argument variable
close
argv
%=
<<
15. Function to empty the contents of a file - no recovery is possible
in
%r
%s
truncate
16. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
|
int
return
raise
17. This keyword begins the simplest form of a conditional statement.
%=
>=
if
for
18. End header line.
*
print
:
str()
19. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
try
if
a//b
20. Prints a string to the screen which will be Unicode.
continue
*=
file.readline()
%s
21. prints its parameter to the console
#
print()
a**b
=
22. Argument variable
argv
%d
/=
and
23. 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
-=
close
>>
file.readline()
24. rounds a number to the number of decimal points you choose
round()
del
-=
a**b
25. Adds something to a variable
=
input()
else
-
26. A statement that breaks out of a loop.
open()
print()
=
break
27. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
continue
argv
=
28. Less than or equal to symbol
Variables
|
&
<=
29. turns an object into an integer
&
int()
input()
<<
30. subtract AND assignment operator
()
*truncate
str()
-=
31. A statement that ends the current iteration of a loop but continues looping.
*=
continue
>>
&
32. exponentiation
append()
*
close
a**b
33. Writes stuff to the file.
and
try
*write(stuff)
#
34. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
~
abs(a)
format string
else
35. 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
-
n
>>
>
36. Prints a string to the screen which is converted using repr()
%r
and
for
*
37. Command to print to the screen
file.write(stuff)
%d
>=
print
38. divide AND assignment operator
/=
int()
format string
not in
39. A logical operator which returns a value of True if either of the conditions is true.
in
in
//=
or
40. A built-in function that converts integers and strings to floating-point numbers.
**=
in
open()
float
41. adds an item to a list
readline
file.seek()
append()
a**b
42. modulo
//=
a%b
Variables
math.sqrt(a)
43. add AND assignment operator
&
%d
+=
close
44. absolute value
abs(a)
#
argv
not
45. unction to read one line of a file
in
**=
not
readline
46. Less than symbol
in
argument variable
<
not
47. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
#
%=
print()
48. adds an item to a list
append()
close
#
%d
49. Reads the contents of the file you can assign the result to a variable.
int()
&
float
*read
50. Symbol to add things together
+
readline
-
()