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. Symbol to divide by the number to the right of the symbol
math.sqrt(a)
*=
len()
/
2. prints its parameter to the console
%s
print()
truncate
input()
3. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
^
if
raise
4. returns the length of a string (number of characters)
truncate
argument variable
return
len()
5. modulus AND assignment operator
|
for
%=
6. Reads the contents of the file you can assign the result to a variable.
int()
+
//=
*read
7. Less than symbol
<
abs(a)
math.sqrt(a)
elif (Else if)
8. turns an object into a string
class
str()
del
del
9. absolute value
abs(a)
^
write
a//b
10. Symbol to multiply things
*
append()
file.readline()
|
11. exponentiation
<=
a**b
close
:
12. This keyword begins the simplest form of a conditional statement.
*readline
*
if
read
13. subtract AND assignment operator
file.write(stuff)
*truncate
**=
-=
14. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
%
math.sqrt(a)
except
15. exponent AND assignment operator
**=
del
=
if
16. A keyword that does nothing but fill space to indicate code which will be written later.
pass
open()
file.seek()
17. A statement that displays a value on the screen.
print
~
n
file.seek()
18. returns the length of a string (number of characters)
len()
else
math.sqrt(a)
19. add AND assignment operator
floating point number
+=
%
readline
20. Symbol to divide by the number to the right of the symbol
>>
truncate
/
^
21. Function to close a file - it will not be able to be used again unless the file is opened.
:
*write(stuff)
()
close
22. Symbol to add things together
a%b
%=
>>
+
23. ,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.
is not
*read
argv
24. 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
len()
write
try
25. square root
not
-
math.sqrt(a)
del
26. Adds something to a variable
.py
break
=
str()
27. Command to print to the screen
print
>=
//=
>
28. Prevents a runtime error from stopping the program.
*
>
except
=
29. 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
insert()
open()
>>
math.sqrt(a)
30. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
/=
+=
-
31. Greater than symbol
=
>
<=
>=
32. modulus AND assignment operator
*truncate
%=
print
raise
33. floor division AND assignment operator
for
//=
Variables
int()
34. prints its parameter to the console
raise
print()
+
35. turns an object into an integer
float
abs(a)
print
int()
36. square root
//=
print
math.sqrt(a)
<
37. This statement causes an exception.
for
raise
del
class
38. Prints a string to the screen which is converted using repr()
math.sqrt(a)
//=
raise
%r
39. adds an item to a list
file.readline()
append()
<<
argv
40. The extension for Python scripts
.py
a**b
int
file.write(stuff)
41. Greater than or equal symbol.
>=
=
int
+
42. Symbol used to create comments
a%b
is
truncate
#
43. An operator that removes a value from a list.
-=
elif (Else if)
del
44. Prints a string to the screen which is a signed decimal.
%d
~
is not
%s
45. Function to read the contents of a file
%=
read
def
print
46. Prints a string to the screen which will be Unicode.
%s
Variables
/=
append()
47. asks the user for a response and returns that response
print()
input()
a**b
#
48. Function to close a file - it will not be able to be used again unless the file is opened.
close
a//b
file.truncate()
%d
49. Modulus operator. It's the remainder after division
argv
%
:
math.sqrt(a)
50. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
argv
>=
int()