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 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
=
str()
<<
format string
2. This statement causes an exception.
&
file.truncate()
%s
raise
3. Less than or equal to symbol
str()
%s
<=
len()
4. This keyword begins the simplest form of a conditional statement.
<
^
for
if
5. turns an object into an integer
int
-
int()
-=
6. prints its parameter to the console
int()
print()
else
abs(a)
7. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
<<
class
#
*=
8. Greater than symbol
>
read
:
:
9. This keyword begins a header for a body that repeats until the condition is no longer true.
int()
while
%
break
10. Prints a string to the screen which is a signed decimal.
%d
insert()
>>
a%b
11. reads just one line of a text file & keeps track of where in the file you're at
int
|
-
file.readline()
12. Symbol used to create comments
Variables
open()
#
>=
13. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
n
round()
truncate
14. assignment operator
write
=
*
else
15. Reads the contents of the file you can assign the result to a variable.
%
*read
%
%r
16. Writes stuff to the file.
assignment
%
*write(stuff)
return
17. Function to close a file - it will not be able to be used again unless the file is opened.
append()
file.seek()
#
close
18. A logical operator which negates an expression so that it returns a value of True if the expression is false.
raise
not
<<
=
19. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
<=
int()
is
20. floor division
close
a//b
<<
a**b
21. The keyword beginning a header that will create a loop.
for
%
:
==
22. A logical operator which returns a value of True if either of the conditions is true.
/=
or
floating point number
int
23. The extension for Python scripts
()
.py
write
-
24. Symbol to subtract things from each other
:
-
%s
readline
25. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
str()
n
|
and
26. Prints a string to the screen which will be Unicode.
len()
%s
append()
-=
27. exponentiation
a**b
%r
*truncate
argv
28. Prints a string to the screen which is a signed decimal.
n
and
%d
abs(a)
29. A statement that breaks out of a loop.
+
int()
break
is not
30. Symbol to add things together
print
is not
len()
+
31. unction to read one line of a file
print()
input()
readline
-=
32. Adds a new line character
while
&
n
-
33. deletes an item from a list
a//b
def
del
//=
34. prints its parameter to the console
print()
=
math.sqrt(a)
or
35. floor division
a//b
=
<
and
36. floor division AND assignment operator
return
//=
input()
%=
37. This keyword in the body of a conditional - gives an alternative execution.
else
int()
append()
*readline
38. 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
^
>>
math.sqrt(a)
=
39. 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
>>
-
#
floating point number
40. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
return
%d
%d
41. modulo
a%b
readline
input()
42. asks the user for a response and returns that response
input()
%d
=
//=
43. unction to read one line of a file
abs(a)
write
<<
readline
44. Function to empty the contents of a file - no recovery is possible
argv
truncate
=
%
45. A logical operator which compares two operands and produces True if they are equal and False otherwise
+
/
==
truncate
46. A logical operator which requires two expressions to both be true.
%
*read
and
:
47. Symbol to subtract things from each other
file.write(stuff)
-
&
class
48. exponent AND assignment operator
input()
pass
append()
**=
49. modulus AND assignment operator
%=
round()
a//b
n
50. Adds a new line character
n
*truncate
<<
read