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 XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001
^
raise
//=
<=
2. square root
:
str()
math.sqrt(a)
*read
3. A keyword that does nothing but fill space to indicate code which will be written later.
return
&
pass
#
4. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.
:
try
not in
==
5. Writes stuff to the file.
*write(stuff)
truncate
*
<
6. modulo
:
del
a%b
%s
7. Prevents a runtime error from stopping the program.
except
len()
write
truncate
8. This keyword begins a header for a body that repeats until the condition is no longer true.
str
while
-
|
9. single line comment
while
#
*readline
==
10. exponent AND assignment operator
for
**=
argv
format string
11. Prints a string to the screen which will be Unicode.
.py
%s
~
if
12. turns an object into a string
str()
/
+=
readline
13. Greater than symbol
len()
file.seek()
#
>
14. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
<=
-
()
~
15. rounds a number to the number of decimal points you choose
-=
read
format string
round()
16. Modulus operator. It's the remainder after division
str()
write
%
float
17. exponentiation
=
n
close
a**b
18. Create a variable.
=
else
math.sqrt(a)
%
19. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
%=
append()
Variables
print()
20. A logical operator which negates an expression so that it returns a value of True if the expression is false.
math.sqrt(a)
+
not
/
21. An operator that removes a value from a list.
print
n
del
round()
22. multiply AND assignment operator
<<
*=
try
elif (Else if)
23. A logical operator which compares two operands and produces True if they are equal and False otherwise
if
==
continue
-
24. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
input()
in
and
def
25. 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
not in
%s
int()
>>
26. A built-in function that converts integers and strings to floating-point numbers.
Variables
or
a**b
float
27. unction to read one line of a file
float
in
str
readline
28. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
argv
>
%s
29. modulo
str()
a%b
len()
30. 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
#
>=
*truncate
31. absolute value
.py
del
abs(a)
input()
32. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
()
&
/=
//=
33. Turns a line into a comment instead of executable code.
for
#
format string
class
34. Function to read the contents of a file
read
>
-=
:
35. A logical operator which requires two expressions to both be true.
#
and
%
if
36. 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
<<
*write(stuff)
%
()
37. floor division
*=
=
int()
a//b
38. Less than symbol
insert()
int
in
<
39. Function to open or read a file
readline
if
//=
open()
40. ,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.
<
%r
abs(a)
41. Adds a new line character
n
readline
&
~
42. Command to print to the screen
math.sqrt(a)
int()
=
print
43. assignment operator
%d
=
.py
^
44. This statement exits a function. The remaining lines of the function are not executed.
truncate
close
not in
return
45. Function to open or read a file
readline
open()
input()
float
46. Symbol to subtract things from each other
-
Variables
%s
if
47. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
=
=
format string
print()
48. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
print()
a**b
int()
&
49. asks the user for a response and returns that response
input()
=
if
:
50. Argument variable
print()
argv
int()
&