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. A statement that breaks out of a loop.
for
len()
while
break
2. asks the user for a response and returns that response
**=
#
input()
//=
3. Writes stuff to the file.
*write(stuff)
write
==
while
4. The keyword beginning a header that will create a new function.
%d
*
def
open()
5. Greater than or equal symbol.
=
+=
a%b
>=
6. The keyword beginning a header that will create a loop.
for
raise
**=
%=
7. deletes an item from a list
del
n
write
try
8. square root
file.readline()
floating point number
math.sqrt(a)
+
9. Less than or equal to symbol
file.write(stuff)
len()
<=
int()
10. Where the parameters go. A necessary punctuation after any function even if it's empty.
+=
try
input()
()
11. Symbol used to create comments
.py
#
<=
if
12. Greater than symbol
else
>
write
round()
13. assignment operator
pass
file.readline()
.py
=
14. modulus AND assignment operator
|
%=
%d
in
15. floor division
in
a**b
a//b
*
16. Symbol to add things together
append()
+
math.sqrt(a)
/
17. absolute value
^
abs(a)
*readline
#
18. prints its parameter to the console
print()
%s
argv
>=
19. 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.
^
*=
argument variable
is not
20. Adds a new line character
int()
n
class
&
21. Empties the file - watch out if you care about the file.
*truncate
def
not in
>>
22. Symbol to multiply things
in
*
close
abs(a)
23. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
del
%=
argv
&
24. An operator that removes a value from a list.
#
del
len()
def
25. turns an object into a string
argv
str()
round()
%r
26. writes stuff to the file
file.write(stuff)
return
round()
str
27. A logical operator which requires two expressions to both be true.
file.readline()
print()
-
and
28. Function to write something to a file
abs(a)
write
truncate
is
29. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
elif (Else if)
abs(a)
print
int
30. Function to close a file - it will not be able to be used again unless the file is opened.
close
abs(a)
not
try
31. Adds something to a variable
*read
=
is
open()
32. Function to read the contents of a file
print
/
read
:
33. Prints a string to the screen which is converted using repr()
%r
>>
file.readline()
~
34. unction to read one line of a file
%r
%=
del
readline
35. End header line.
for
&
input()
:
36. A logical operator which negates an expression so that it returns a value of True if the expression is false.
%s
~
not
a%b
37. This keyword begins the simplest form of a conditional statement.
del
*
#
if
38. Modulus operator. It's the remainder after division
%
truncate
readline
**=
39. reads just one line of a text file & keeps track of where in the file you're at
#
file.readline()
for
try
40. The extension for Python scripts
write
file.write(stuff)
.py
is
41. Prints a string to the screen which is a signed decimal.
-
>=
str()
%d
42. adds an item to a list
round()
<
append()
close
43. Command to print to the screen
print
=
for
print()
44. subtract AND assignment operator
-=
return
insert()
in
45. Function to write something to a file
insert()
write
-=
a//b
46. returns the length of a string (number of characters)
len()
.py
if
write
47. square root
str()
<=
math.sqrt(a)
/
48. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
Variables
~
**=
math.sqrt(a)
49. Function to open or read a file
open()
print()
argument variable
is
50. Symbol to divide by the number to the right of the symbol
|
else
:
/