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
|
a//b
/
for
2. 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
//=
<<
%
%d
3. rounds a number to the number of decimal points you choose
del
//=
round()
%r
4. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
str
=
//=
5. Symbol to subtract things from each other
print
elif (Else if)
input()
-
6. square root
math.sqrt(a)
>>
<
-=
7. The keyword beginning a header that will create a new function.
*truncate
>
del
def
8. Empties the file - watch out if you care about the file.
pass
a//b
*truncate
<<
9. The keyword beginning a header that will create a loop.
math.sqrt(a)
*=
for
>=
10. turns an object into an integer
int
del
+
int()
11. The keyword beginning a header that will create a new function.
def
argument variable
~
str()
12. Adds a new line character
a%b
*write(stuff)
#
n
13. A statement that breaks out of a loop.
<=
break
floating point number
%=
14. 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
*truncate
math.sqrt(a)
^
a%b
15. assignment operator
not
floating point number
=
else
16. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
if
str()
<<
&
17. The extension for Python scripts
argv
.py
#
*write(stuff)
18. asks the user for a response and returns that response
input()
:
print()
a%b
19. modulus AND assignment operator
del
<
a**b
%=
20. adds an item to a list
continue
*
append()
<=
21. Greater than symbol
>
**=
str()
return
22. This keyword begins the simplest form of a conditional statement.
if
str()
a//b
a//b
23. Less than symbol
del
file.write(stuff)
<
while
24. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
%=
else
|
n
25. add AND assignment operator
except
*
append()
+=
26. subtract AND assignment operator
print()
-=
&
/=
27. This keyword in the body of a conditional - gives an alternative execution.
else
%r
str
>>
28. Modulus operator. It's the remainder after division
%
abs(a)
%d
class
29. This statement exits a function. The remaining lines of the function are not executed.
and
print
-=
return
30. Create a variable.
in
is
def
=
31. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
not in
>>
=
32. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
open()
**=
#
33. sets the file's current position
str
^
close
file.seek()
34. Less than symbol
#
<
elif (Else if)
%s
35. Less than or equal to symbol
==
if
<=
%s
36. modulus AND assignment operator
%=
assignment
len()
Variables
37. Greater than symbol
>
*
truncate
/=
38. The keyword beginning a header that will create a loop.
for
abs(a)
format string
argument variable
39. Prints a string to the screen which will be Unicode.
math.sqrt(a)
%s
assignment
+
40. Command to print to the screen
read
a**b
print
not in
41. Prevents a runtime error from stopping the program.
abs(a)
.py
assignment
except
42. deletes an item from a list
-
>
=
del
43. prints its parameter to the console
write
print()
>=
>=
44. A data type for representing numbers with fractional values.
|
int()
floating point number
%=
45. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
int()
append()
def
in
46. rounds a number to the number of decimal points you choose
%d
round()
n
.py
47. empties the file
>>
format string
file.truncate()
abs(a)
48. Argument variable
argv
.py
in
&
49. A logical operator which compares two operands and produces True if they are equal and False otherwise
%
del
#
==
50. ,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.
print
<=
%s