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. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
len()
in
*
2. returns the length of a string (number of characters)
input()
**=
int()
len()
3. turns an object into an integer
#
int()
argv
>
4. Function to empty the contents of a file - no recovery is possible
>
print
-
truncate
5. 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
#
>>
<
a%b
6. Function to open or read a file
abs(a)
open()
math.sqrt(a)
==
7. Prints a string to the screen which will be Unicode.
abs(a)
argv
%s
file.write(stuff)
8. Function to close a file - it will not be able to be used again unless the file is opened.
~
close
%r
**=
9. sets the file's current position
file.seek()
a**b
print
a%b
10. Turns a line into a comment instead of executable code.
>
#
file.truncate()
if
11. A logical operator which compares two operands and produces True if they are equal and False otherwise
**=
abs(a)
==
=
12. An operator to check whether two variables refer to the same object.
>>
is
&
<
13. Command to print to the screen
continue
else
print
>=
14. adds an item to a list
append()
-
floating point number
try
15. Reads the contents of the file you can assign the result to a variable.
def
while
append()
*read
16. The keyword beginning a header that will create a new function.
+=
def
a//b
insert()
17. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
and
//=
print
-
18. exponent AND assignment operator
format string
<=
&
**=
19. Greater than or equal symbol.
>=
|
len()
open()
20. Function to open or read a file
and
len()
open()
~
21. absolute value
a**b
abs(a)
while
22. Argument variable
%=
argv
/=
len()
23. 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
print
file.truncate()
<<
Variables
24. multiply AND assignment operator
file.seek()
*=
open()
or
25. multiply AND assignment operator
-
a%b
open()
*=
26. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
and
print
|
read
27. Symbol to divide by the number to the right of the symbol
close
/
<<
try
28. empties the file
del
argv
append()
file.truncate()
29. exponentiation
read
+
a**b
%s
30. Symbol to subtract things from each other
-
a**b
%d
=
31. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
>=
math.sqrt(a)
print()
32. inserts an item inside a list at a certain index
insert()
else
argument variable
-
33. exponentiation
append()
a**b
==
/
34. Prevents a runtime error from stopping the program.
^
except
+
del
35. Function to write something to a file
file.truncate()
file.write(stuff)
a%b
write
36. This statement causes an exception.
open()
raise
if
a**b
37. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
insert()
*read
-
class
38. add AND assignment operator
in
+=
()
close
39. floor division
~
append()
|
a//b
40. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
%d
~
len()
*
41. Function to read the contents of a file
file.seek()
append()
read
42. Argument variable
*
argv
not in
:
43. assignment operator
print()
~
>
=
44. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
Variables
int
len()
argv
45. Symbol to multiply things
*
else
del
<=
46. Adds something to a variable
a%b
=
//=
/
47. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
-=
append()
**=
&
48. writes stuff to the file
file.write(stuff)
a**b
n
int()
49. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
#
in
len()
#
50. The extension for Python scripts
%s
.py
=
file.readline()