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. turns an object into a string
str()
==
%d
-
2. Function to close a file - it will not be able to be used again unless the file is opened.
def
//=
close
readline
3. Where the parameters go. A necessary punctuation after any function even if it's empty.
not in
()
append()
<
4. 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.
argv
in
:
=
5. Argument variable
//=
==
argv
6. This keyword in the body of a conditional - gives an alternative execution.
while
else
+=
truncate
7. Symbol to subtract things from each other
~
-
argv
elif (Else if)
8. exponent AND assignment operator
def
==
**=
if
9. Symbol to multiply things
is not
math.sqrt(a)
open()
*
10. divide AND assignment operator
close
/=
=
for
11. The keyword beginning a header that will create a new function.
//=
**=
def
<
12. This keyword begins a header for a body that repeats until the condition is no longer true.
&
if
while
>>
13. empties the file
>>
file.truncate()
if
argv
14. exponent AND assignment operator
**=
class
not in
truncate
15. absolute value
abs(a)
*write(stuff)
argv
*
16. Prints a string to the screen which is a signed decimal.
+=
not in
^
%d
17. A keyword that does nothing but fill space to indicate code which will be written later.
=
pass
file.seek()
else
18. reads just one line of a text file & keeps track of where in the file you're at
&
file.readline()
while
~
19. turns an object into an integer
return
print()
>
int()
20. Empties the file - watch out if you care about the file.
append()
math.sqrt(a)
*truncate
int()
21. The keyword beginning a header that will create a new function.
def
close
#
for
22. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
|
**=
~
23. Function to write something to a file
%=
in
Variables
write
24. Prevents a runtime error from stopping the program.
except
or
int()
-
25. Function to empty the contents of a file - no recovery is possible
**=
&
()
truncate
26. The extension for Python scripts
is not
.py
>>
-=
27. Create a variable.
not in
=
-=
-=
28. assignment operator
=
>>
|
^
29. multiply AND assignment operator
insert()
*=
truncate
~
30. End header line.
file.write(stuff)
:
a**b
del
31. A statement that assigns a value to a variable.
assignment
str()
not
a**b
32. turns an object into an integer
abs(a)
del
int()
int
33. A logical operator which compares two operands and produces True if they are equal and False otherwise
try
|
==
str()
34. Symbol used to create comments
#
+
a**b
assignment
35. floor division AND assignment operator
is
readline
//=
for
36. A built-in function that converts integers and strings to floating-point numbers.
~
<=
truncate
float
37. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
*readline
in
write
print()
38. turns an object into a string
+=
print
write
str()
39. Reads the contents of the file you can assign the result to a variable.
not in
*read
/=
elif (Else if)
40. Where the parameters go. A necessary punctuation after any function even if it's empty.
<<
class
a//b
()
41. Prints a string to the screen which will be Unicode.
a**b
+
%s
or
42. The extension for Python scripts
=
.py
/
Variables
43. Less than or equal to symbol
<=
in
continue
|
44. Function to read the contents of a file
Variables
read
truncate
+
45. The keyword beginning a header that will create a loop.
str()
for
%s
if
46. Prints a string to the screen which is converted using repr()
input()
*read
in
%r
47. Symbol to add things together
^
-=
+
=
48. A statement that breaks out of a loop.
round()
%r
%r
break
49. deletes an item from a list
n
del
for
print
50. 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.
str()
while
argument variable
file.write(stuff)