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. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
abs(a)
str()
|
/=
2. ,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.
%
%d
Variables
3. Turns a line into a comment instead of executable code.
<=
>
=
#
4. prints its parameter to the console
==
**=
+
print()
5. Less than symbol
while
#
a**b
<
6. single line comment
>>
input()
#
Variables
7. Adds a new line character
abs(a)
n
%s
in
8. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
-=
<=
else
9. Writes stuff to the file.
#
is
*write(stuff)
-
10. unction to read one line of a file
math.sqrt(a)
%
readline
raise
11. Prints a string to the screen which is a signed decimal.
readline
%r
%=
%d
12. turns an object into a string
math.sqrt(a)
n
%s
str()
13. rounds a number to the number of decimal points you choose
def
close
not in
round()
14. The keyword beginning a header that will create a loop.
open()
insert()
truncate
for
15. Empties the file - watch out if you care about the file.
insert()
*truncate
>
file.write(stuff)
16. A logical operator which requires two expressions to both be true.
insert()
and
readline
-
17. This keyword in the body of a conditional allows chained conditionals.
input()
math.sqrt(a)
=
elif (Else if)
18. floor division
=
argument variable
%
a//b
19. rounds a number to the number of decimal points you choose
round()
*=
if
a//b
20. subtract AND assignment operator
-=
input()
*
~
21. Prints a string to the screen which is converted using repr()
%r
/=
else
print()
22. The keyword beginning a header that will create a loop.
truncate
str()
<<
for
23. Command to print to the screen
:
n
print
()
24. exponent AND assignment operator
**=
if
file.readline()
abs(a)
25. A statement that ends the current iteration of a loop but continues looping.
try
readline
#
continue
26. square root
%r
*read
else
math.sqrt(a)
27. Greater than symbol
=
+
in
>
28. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
file.write(stuff)
in
&
+
29. The extension for Python scripts
format string
%d
.py
readline
30. Function to write something to a file
>>
readline
write
len()
31. Symbol to subtract things from each other
-
>>
int()
*
32. absolute value
abs(a)
if
<
or
33. floor division
def
**=
len()
a//b
34. Adds a new line character
<
a**b
n
round()
35. This statement exits a function. The remaining lines of the function are not executed.
print()
return
*=
<<
36. Reads the contents of the file you can assign the result to a variable.
==
*read
and
+=
37. 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.
abs(a)
argument variable
a//b
|
38. Prints a string to the screen which will be Unicode.
#
print()
%s
write
39. returns the length of a string (number of characters)
def
len()
and
<=
40. Prevents a runtime error from stopping the program.
pass
except
%=
&
41. deletes an item from a list
%r
class
del
print
42. A logical operator which returns a value of True if either of the conditions is true.
input()
or
#
file.seek()
43. 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
a//b
>>
if
<<
44. A logical operator which negates an expression so that it returns a value of True if the expression is false.
readline
not
=
insert()
45. Function to read the contents of a file
is
insert()
read
append()
46. Greater than or equal symbol.
>=
int()
~
not
47. assignment operator
#
readline
=
a**b
48. modulus AND assignment operator
open()
>=
%=
elif (Else if)
49. exponent AND assignment operator
%r
**=
class
del
50. deletes an item from a list
//=
//=
del
int