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. The extension for Python scripts
.py
while
str()
2. A statement that assigns a value to a variable.
print
assignment
=
/=
3. add AND assignment operator
else
//=
+=
**=
4. Command to print to the screen
else
print
>
abs(a)
5. 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
^
except
elif (Else if)
:
6. Function to write something to a file
def
write
#
.py
7. Greater than symbol
=
|
is
>
8. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
if
def
round()
9. Function to write something to a file
a//b
del
not in
write
10. A statement that breaks out of a loop.
=
close
try
break
11. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
()
math.sqrt(a)
~
//=
12. Adds a new line character
.py
^
is not
n
13. assignment operator
=
abs(a)
#
close
14. Function to close a file - it will not be able to be used again unless the file is opened.
%
def
close
print
15. Less than or equal to symbol
argv
<=
a//b
del
16. A statement that ends the current iteration of a loop but continues looping.
continue
argv
insert()
is
17. adds an item to a list
file.readline()
append()
del
def
18. Create a variable.
truncate
int()
=
%
19. sets the file's current position
for
argv
file.seek()
*
20. turns an object into a string
print()
else
str()
if
21. returns the length of a string (number of characters)
len()
%r
~
read
22. exponent AND assignment operator
**=
open()
is not
floating point number
23. multiply AND assignment operator
for
:
*=
&
24. 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
print()
print()
in
25. divide AND assignment operator
/=
n
print()
argv
26. This keyword begins the simplest form of a conditional statement.
if
^
+=
-=
27. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
abs(a)
math.sqrt(a)
*truncate
Variables
28. exponentiation
>>
class
a**b
str()
29. This keyword in the body of a conditional allows chained conditionals.
continue
write
elif (Else if)
^
30. Symbol used to create comments
**=
pass
#
%s
31. This keyword begins a header for a body that repeats until the condition is no longer true.
print
while
#
math.sqrt(a)
32. Less than or equal to symbol
insert()
abs(a)
not
<=
33. Function to empty the contents of a file - no recovery is possible
.py
class
truncate
assignment
34. asks the user for a response and returns that response
>
float
format string
input()
35. Empties the file - watch out if you care about the file.
insert()
*truncate
def
^
36. The keyword beginning a header that will create a loop.
is
open()
for
-
37. reads just one line of a text file & keeps track of where in the file you're at
*=
file.readline()
%
a**b
38. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
=
|
file.write(stuff)
continue
39. Function to empty the contents of a file - no recovery is possible
a//b
str()
truncate
&
40. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
#
%r
or
41. empties the file
%
^
==
file.truncate()
42. assignment operator
#
=
print
else
43. End header line.
file.readline()
for
>>
:
44. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
~
class
truncate
argv
45. add AND assignment operator
continue
>>
math.sqrt(a)
+=
46. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.
~
while
argument variable
>
47. End header line.
+
>
:
#
48. Modulus operator. It's the remainder after division
#
return
%s
%
49. unction to read one line of a file
*truncate
>=
readline
argv
50. 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
and
=
==
>>