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. 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.
<<
a//b
()
not in
2. subtract AND assignment operator
a**b
-=
truncate
else
3. The extension for Python scripts
write
:
%d
.py
4. add AND assignment operator
+=
is not
read
=
5. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
print
and
#
read
6. 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
argv
<<
^
7. Less than or equal to symbol
>>
>
<=
argv
8. Prints a string to the screen which will be Unicode.
>=
%s
read
insert()
9. A logical operator which negates an expression so that it returns a value of True if the expression is false.
readline
<<
not
return
10. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
readline
|
else
not
11. prints its parameter to the console
read
print()
for
while
12. Prints a string to the screen which is converted using repr()
%r
len()
n
%d
13. divide AND assignment operator
elif (Else if)
>>
truncate
/=
14. Symbol to divide by the number to the right of the symbol
assignment
-
/
not
15. The keyword beginning a header that will create a loop.
&
del
abs(a)
for
16. Greater than symbol
>
truncate
()
/
17. Prints a string to the screen which is a signed decimal.
n
readline
**=
%d
18. The keyword beginning a header that will create a new function.
del
def
>
if
19. reads just one line of a text file & keeps track of where in the file you're at
str()
+
int()
file.readline()
20. Less than or equal to symbol
while
=
<=
%=
21. Less than symbol
in
<
<=
if
22. Function to write something to a file
math.sqrt(a)
+
write
>
23. modulus AND assignment operator
input()
append()
**=
%=
24. Where the parameters go. A necessary punctuation after any function even if it's empty.
*readline
insert()
()
file.seek()
25. 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
in
>>
<<
not in
26. Modulus operator. It's the remainder after division
a//b
%
%=
%s
27. floor division
~
else
a//b
not in
28. subtract AND assignment operator
write
round()
file.readline()
-=
29. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
*truncate
raise
*readline
30. Function to empty the contents of a file - no recovery is possible
truncate
^
def
*
31. Adds a new line character
raise
n
str
<
32. returns the length of a string (number of characters)
+=
len()
=
()
33. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
-=
int
=
Variables
34. A statement that breaks out of a loop.
abs(a)
while
break
%r
35. empties the file
print
and
^
file.truncate()
36. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.
in
*readline
read
def
37. Symbol to add things together
-=
argument variable
+
print
38. absolute value
def
and
*
abs(a)
39. exponent AND assignment operator
%s
**=
%=
=
40. A statement that displays a value on the screen.
print
if
print()
/=
41. 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
=
()
>>
class
42. Symbol used to create comments
str
math.sqrt(a)
*=
#
43. Function to open or read a file
=
()
%
open()
44. unction to read one line of a file
readline
:
and
input()
45. Empties the file - watch out if you care about the file.
str
%
*truncate
//=
46. Adds something to a variable
//=
open()
*write(stuff)
=
47. Reads the contents of the file you can assign the result to a variable.
>=
*read
%d
len()
48. modulo
math.sqrt(a)
input()
^
a%b
49. exponentiation
a**b
.py
*=
=
50. adds an item to a list
print
close
<
append()