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. modulus AND assignment operator
%r
%=
open()
else
2. Symbol to divide by the number to the right of the symbol
/
=
:
%=
3. Function to write something to a file
%s
<<
write
break
4. unction to read one line of a file
=
readline
continue
()
5. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
is
%r
-=
6. 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.
int()
a**b
not in
**=
7. Less than symbol
<
.py
else
close
8. exponentiation
a**b
int()
&
while
9. Modulus operator. It's the remainder after division
break
%
>>
.py
10. deletes an item from a list
del
if
>>
%s
11. A logical operator which negates an expression so that it returns a value of True if the expression is false.
a**b
<
file.write(stuff)
not
12. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
read
class
insert()
in
13. ,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
==
not
14. Symbol to subtract things from each other
/=
<
-
<<
15. adds an item to a list
argv
round()
if
append()
16. sets the file's current position
file.seek()
float
len()
abs(a)
17. A statement that ends the current iteration of a loop but continues looping.
continue
~
+=
for
18. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
int()
~
^
del
19. Symbol to add things together
*=
>>
()
+
20. Symbol used to create comments
.py
#
pass
%d
21. 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
str
>>
insert()
<<
22. turns an object into a string
str()
append()
n
**=
23. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
and
^
insert()
math.sqrt(a)
24. modulus AND assignment operator
/
+
%=
is not
25. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
n
in
close
^
26. The keyword beginning a header that will create a loop.
//=
%=
for
argument variable
27. turns an object into an integer
//=
int()
math.sqrt(a)
or
28. Create a variable.
#
abs(a)
>=
=
29. The keyword beginning a header that will create a new function.
&
file.truncate()
def
>=
30. assignment operator
file.truncate()
read
=
*=
31. writes stuff to the file
*truncate
Variables
in
file.write(stuff)
32. The extension for Python scripts
&
.py
abs(a)
len()
33. floor division
a//b
continue
==
+
34. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
floating point number
truncate
try
in
35. absolute value
*=
print
abs(a)
and
36. 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
a**b
/
^
and
37. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
>
>>
argv
38. Adds a new line character
n
len()
append()
and
39. This keyword begins a header for a body that repeats until the condition is no longer true.
abs(a)
&
while
<<
40. Empties the file - watch out if you care about the file.
*truncate
round()
<=
%=
41. A logical operator which requires two expressions to both be true.
and
:
format string
raise
42. Prints a string to the screen which will be Unicode.
class
print
%s
insert()
43. The extension for Python scripts
/
|
.py
-
44. A logical operator which returns a value of True if either of the conditions is true.
try
str()
or
=
45. unction to read one line of a file
~
readline
append()
float
46. This keyword in the body of a conditional - gives an alternative execution.
else
()
>
assignment
47. 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
<<
-
**=
readline
48. An operator that removes a value from a list.
+=
return
del
a%b
49. asks the user for a response and returns that response
input()
except
=
truncate
50. Where the parameters go. A necessary punctuation after any function even if it's empty.
open()
()
round()
<<