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. Greater than or equal symbol.
=
>=
#
2. turns an object into a string
close
int()
.py
str()
3. Function to open or read a file
try
open()
%s
//=
4. prints its parameter to the console
close
*truncate
print()
%d
5. Where the parameters go. A necessary punctuation after any function even if it's empty.
not
()
a%b
def
6. Less than symbol
<
>>
except
del
7. unction to read one line of a file
and
+
<=
readline
8. Argument variable
file.truncate()
argv
|
>=
9. Function to empty the contents of a file - no recovery is possible
truncate
raise
else
and
10. Function to close a file - it will not be able to be used again unless the file is opened.
else
close
*=
=
11. assignment operator
del
=
floating point number
()
12. floor division
n
del
append()
a//b
13. Command to print to the screen
print
//=
a**b
input()
14. Adds a new line character
n
+
round()
insert()
15. A statement that assigns a value to a variable.
assignment
^
-
abs(a)
16. A statement that ends the current iteration of a loop but continues looping.
int
len()
continue
:
17. reads just one line of a text file & keeps track of where in the file you're at
a//b
%r
n
file.readline()
18. Function to write something to a file
write
readline
print()
str()
19. add AND assignment operator
open()
print
+=
float
20. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
+=
pass
//=
int
21. 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.
file.seek()
class
open()
argument variable
22. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
else
file.readline()
*=
&
23. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
#
and
:
24. modulo
a%b
and
input()
math.sqrt(a)
25. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
Variables
*read
round()
format string
26. Prints a string to the screen which will be Unicode.
else
%s
input()
file.write(stuff)
27. The extension for Python scripts
readline
for
a//b
.py
28. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
file.seek()
%s
~
break
29. This keyword in the body of a conditional - gives an alternative execution.
else
*read
print
file.write(stuff)
30. sets the file's current position
file.seek()
open()
<=
n
31. subtract AND assignment operator
format string
=
-=
.py
32. floor division AND assignment operator
:
.py
%d
//=
33. Prints a string to the screen which is a signed decimal.
%d
truncate
not in
<
34. 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
int()
for
<<
*write(stuff)
35. Turns a line into a comment instead of executable code.
argv
|
#
=
36. 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
%d
<<
elif (Else if)
<=
37. 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
%=
&
+
^
38. Symbol to add things together
|
int()
+
%d
39. empties the file
len()
len()
file.truncate()
>=
40. 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
while
abs(a)
not in
>>
41. A logical operator which compares two operands and produces True if they are equal and False otherwise
elif (Else if)
^
==
readline
42. Symbol to multiply things
*
str
/
int
43. modulus AND assignment operator
//=
is
%=
abs(a)
44. 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.
len()
in
*
//=
45. asks the user for a response and returns that response
append()
-
input()
abs(a)
46. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
and
for
<<
*readline
47. Symbol to multiply things
*
file.readline()
round()
truncate
48. A built-in function that converts its argument to a string.
str
<=
print
print
49. Greater than or equal symbol.
str
=
/=
>=
50. exponentiation
#
close
abs(a)
a**b