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. inserts an item inside a list at a certain index
insert()
if
file.truncate()
-=
2. unction to read one line of a file
+
readline
str()
n
3. A statement that ends the current iteration of a loop but continues looping.
round()
continue
len()
>
4. The keyword beginning a header that will create a new function.
n
input()
def
not in
5. turns an object into a string
del
def
print
str()
6. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
>>
in
for
7. writes stuff to the file
//=
a//b
write
file.write(stuff)
8. Symbol to subtract things from each other
-
=
&
float
9. unction to read one line of a file
>
readline
elif (Else if)
float
10. Function to close a file - it will not be able to be used again unless the file is opened.
<<
print()
file.write(stuff)
close
11. modulo
%
=
is
a%b
12. subtract AND assignment operator
print()
*
-=
print
13. Function to read the contents of a file
readline
for
read
file.write(stuff)
14. divide AND assignment operator
%d
//=
/=
n
15. Empties the file - watch out if you care about the file.
len()
>>
*truncate
int
16. Where the parameters go. A necessary punctuation after any function even if it's empty.
a%b
Variables
is
()
17. The extension for Python scripts
return
argv
.py
math.sqrt(a)
18. exponentiation
readline
a**b
/
readline
19. 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
argv
truncate
<<
len()
20. Symbol to multiply things
*
%
<=
*=
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.
argument variable
*
-=
>=
22. Greater than or equal symbol.
>=
del
>>
floating point number
23. sets the file's current position
read
#
.py
file.seek()
24. ,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.
argv
Variables
=
25. A logical operator which returns a value of True if either of the conditions is true.
>>
or
.py
assignment
26. This keyword begins a header for a body that repeats until the condition is no longer true.
elif (Else if)
try
print
while
27. Prints a string to the screen which is a signed decimal.
=
%d
a%b
-=
28. modulo
a%b
str()
int
argument variable
29. A statement that displays a value on the screen.
print
int()
file.seek()
%
30. Function to open or read a file
append()
a//b
try
open()
31. rounds a number to the number of decimal points you choose
round()
str
n
a**b
32. deletes an item from a list
del
and
*=
%s
33. Turns a line into a comment instead of executable code.
>>
+=
insert()
#
34. A statement that assigns a value to a variable.
file.write(stuff)
assignment
argv
%r
35. End header line.
>>
#
:
36. 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
Variables
&
if
37. An operator that removes a value from a list.
del
close
*=
print()
38. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
def
round()
break
try
39. Greater than symbol
a%b
>
>=
str()
40. single line comment
#
open()
else
//=
41. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
*=
class
+=
42. Create a variable.
=
in
def
#
43. The extension for Python scripts
n
#
.py
abs(a)
44. Argument variable
argv
n
except
*
45. This keyword begins the simplest form of a conditional statement.
int
>=
if
return
46. The keyword beginning a header that will create a new function.
<<
def
<<
for
47. prints its parameter to the console
round()
pass
file.write(stuff)
print()
48. divide AND assignment operator
/=
int()
-=
close
49. Writes stuff to the file.
while
for
*write(stuff)
input()
50. exponentiation
for
int
a**b
%r