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. empties the file
<<
file.truncate()
read
break
2. Create a variable.
-=
str()
=
for
3. The keyword beginning a header that will create a loop.
~
a**b
for
floating point number
4. A keyword that does nothing but fill space to indicate code which will be written later.
pass
/
else
while
5. Greater than or equal symbol.
>=
or
read
continue
6. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
floating point number
%s
round()
7. Function to empty the contents of a file - no recovery is possible
float
//=
truncate
<<
8. A statement that breaks out of a loop.
break
=
n
print()
9. The extension for Python scripts
insert()
elif (Else if)
.py
readline
10. The keyword beginning a header that will create a new function.
~
print
def
%d
11. This keyword begins a header for a body that repeats until the condition is no longer true.
while
if
str()
for
12. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
format string
=
print
class
13. turns an object into a string
+
append()
str()
argv
14. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.
-
truncate
for
15. modulus AND assignment operator
a%b
%=
#
append()
16. floor division AND assignment operator
return
insert()
//=
is
17. Symbol to subtract things from each other
-
int
if
str()
18. Symbol to add things together
+
=
>>
%s
19. Adds a new line character
n
str()
%d
**=
20. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
*
while
|
%r
21. This statement causes an exception.
a**b
=
raise
a**b
22. Where the parameters go. A necessary punctuation after any function even if it's empty.
-=
()
//=
a**b
23. rounds a number to the number of decimal points you choose
>
round()
>
=
24. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
while
int
%=
+=
25. A logical operator which compares two operands and produces True if they are equal and False otherwise
floating point number
-=
==
raise
26. A built-in function that converts its argument to a string.
str
and
input()
==
27. Adds a new line character
-=
n
abs(a)
==
28. Function to read the contents of a file
and
^
read
==
29. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
%=
a**b
-
&
30. This keyword in the body of a conditional - gives an alternative execution.
else
break
:
and
31. Symbol to add things together
is
+
if
n
32. A statement that ends the current iteration of a loop but continues looping.
floating point number
open()
continue
+=
33. Reads just one line of a text file.
//=
*readline
<=
#
34. Function to write something to a file
file.readline()
write
or
*read
35. divide AND assignment operator
while
assignment
/=
read
36. Function to empty the contents of a file - no recovery is possible
insert()
=
truncate
round()
37. A data type for representing numbers with fractional values.
close
floating point number
insert()
==
38. Reads the contents of the file you can assign the result to a variable.
^
readline
*read
%s
39. deletes an item from a list
del
print
format string
in
40. Empties the file - watch out if you care about the file.
print
*truncate
<=
n
41. Command to print to the screen
print
<=
del
/
42. writes stuff to the file
floating point number
#
file.write(stuff)
%
43. deletes an item from a list
()
del
^
is
44. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).
is not
and
=
*=
45. turns an object into an integer
close
int()
%
else
46. Adds something to a variable
format string
+
=
print()
47. square root
def
*
/
math.sqrt(a)
48. The keyword beginning a header that will create a loop.
for
is not
==
%
49. floor division
//=
*=
a//b
n
50. Where the parameters go. A necessary punctuation after any function even if it's empty.
*write(stuff)
del
close
()