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. This keyword begins the simplest form of a conditional statement.
if
while
|
close
2. The extension for Python scripts
*=
continue
.py
int()
3. Greater than or equal symbol.
>=
/
read
print
4. End header line.
:
in
()
()
5. Reads just one line of a text file.
print()
not
%d
*readline
6. absolute value
abs(a)
%s
#
input()
7. Command to print to the screen
=
print
+=
*write(stuff)
8. subtract AND assignment operator
math.sqrt(a)
-=
|
>
9. A logical operator which negates an expression so that it returns a value of True if the expression is false.
*write(stuff)
input()
elif (Else if)
not
10. returns the length of a string (number of characters)
**=
len()
%s
-=
11. subtract AND assignment operator
math.sqrt(a)
-=
//=
%
12. 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
^
argv
print()
>>
13. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
==
is not
a//b
14. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
print
*=
float
|
15. reads just one line of a text file & keeps track of where in the file you're at
%s
file.readline()
-
#
16. Adds something to a variable
=
<
file.truncate()
str()
17. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
=
try
elif (Else if)
18. unction to read one line of a file
readline
str()
file.truncate()
%d
19. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).
is not
a%b
*=
>
20. asks the user for a response and returns that response
|
file.truncate()
input()
file.seek()
21. This keyword in the body of a conditional allows chained conditionals.
^
read
elif (Else if)
else
22. adds an item to a list
continue
%s
append()
23. Adds a new line character
and
~
%s
n
24. Reads the contents of the file you can assign the result to a variable.
continue
read
*read
=
25. Function to read the contents of a file
else
read
<
.py
26. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
not
&
break
//=
27. A logical operator which requires two expressions to both be true.
is not
+=
+
and
28. Symbol to divide by the number to the right of the symbol
open()
<<
/
floating point number
29. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
not
%s
&
append()
30. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
del
return
>=
class
31. modulo
%
.py
a%b
()
32. Symbol used to create comments
#
int()
^
%d
33. absolute value
print()
write
*
abs(a)
34. modulus AND assignment operator
%=
in
int()
=
35. An operator to check whether two variables refer to the same object.
is
&
print
&
36. 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
<
>>
*read
>=
37. add AND assignment operator
a//b
Variables
+=
~
38. multiply AND assignment operator
*=
def
file.write(stuff)
*read
39. floor division AND assignment operator
else
//=
class
else
40. 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
<<
//=
round()
**=
41. adds an item to a list
&
append()
print
if
42. 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
%
/
argv
>>
43. Turns a line into a comment instead of executable code.
and
Variables
#
>
44. square root
()
math.sqrt(a)
in
^
45. A statement that ends the current iteration of a loop but continues looping.
a**b
//=
continue
input()
46. Function to open or read a file
try
#
open()
/
47. A statement that displays a value on the screen.
.py
#
%d
print
48. Less than or equal to symbol
<=
del
round()
^
49. Function to open or read a file
=
print
open()
insert()
50. prints its parameter to the console
print()
*=
//=
len()