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 write something to a file
|
a**b
write
==
2. Function to read the contents of a file
a//b
append()
read
file.truncate()
3. Prints a string to the screen which is converted using repr()
print
=
==
%r
4. prints its parameter to the console
print()
str()
append()
+
5. inserts an item inside a list at a certain index
insert()
del
.py
return
6. A statement that breaks out of a loop.
print()
/
-
break
7. Function to close a file - it will not be able to be used again unless the file is opened.
.py
close
a%b
8. This keyword in the body of a conditional - gives an alternative execution.
file.write(stuff)
*readline
~
else
9. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
/
argv
a**b
|
10. The keyword beginning a header that will create a new function.
def
>
>
math.sqrt(a)
11. Function to read the contents of a file
read
del
~
truncate
12. asks the user for a response and returns that response
/
abs(a)
write
input()
13. modulo
del
a%b
for
*truncate
14. Function to open or read a file
&
round()
open()
.py
15. multiply AND assignment operator
:
int
*=
def
16. Empties the file - watch out if you care about the file.
if
insert()
*truncate
abs(a)
17. prints its parameter to the console
print()
a%b
del
del
18. multiply AND assignment operator
%d
>
insert()
*=
19. assignment operator
<=
=
*truncate
*=
20. Create a variable.
file.truncate()
append()
del
=
21. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
/
or
del
class
22. Symbol to add things together
str()
%=
+
input()
23. Create a variable.
=
else
*read
abs(a)
24. rounds a number to the number of decimal points you choose
round()
write
and
argument variable
25. Modulus operator. It's the remainder after division
#
=
%
str()
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
^
|
==
a//b
27. unction to read one line of a file
readline
while
truncate
#
28. adds an item to a list
math.sqrt(a)
append()
/=
=
29. Greater than or equal symbol.
/
>=
file.readline()
a**b
30. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
=
Variables
|
%s
31. divide AND assignment operator
append()
<<
/=
math.sqrt(a)
32. Function to close a file - it will not be able to be used again unless the file is opened.
close
math.sqrt(a)
n
#
33. absolute value
abs(a)
float
print
floating point number
34. The keyword beginning a header that will create a new function.
class
file.truncate()
def
len()
35. floor division AND assignment operator
//=
>>
in
write
36. Symbol to divide by the number to the right of the symbol
/
>=
def
-
37. Function to open or read a file
*write(stuff)
open()
%r
input()
38. A logical operator which compares two operands and produces True if they are equal and False otherwise
input()
-=
a%b
==
39. single line comment
=
()
break
#
40. exponentiation
a**b
=
=
abs(a)
41. 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.
<<
elif (Else if)
>
not in
42. Symbol to multiply things
*
%=
&
//=
43. modulus AND assignment operator
del
()
%=
*readline
44. Writes stuff to the file.
#
*write(stuff)
%s
Variables
45. Reads the contents of the file you can assign the result to a variable.
*read
%s
not
//=
46. 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
break
>>
=
.py
47. floor division
elif (Else if)
+
*
a//b
48. Function to empty the contents of a file - no recovery is possible
truncate
*read
insert()
input()
49. 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
a//b
^
n
#
50. Command to print to the screen
else
==
%s
print