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. turns an object into an integer
>=
+=
int()
file.readline()
2. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
is
readline
a//b
3. absolute value
==
-=
abs(a)
open()
4. Turns a line into a comment instead of executable code.
len()
break
append()
#
5. exponentiation
a**b
-=
readline
/=
6. assignment operator
file.truncate()
=
while
Variables
7. A logical operator which compares two operands and produces True if they are equal and False otherwise
**=
readline
==
for
8. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
len()
>
Variables
n
9. Empties the file - watch out if you care about the file.
round()
or
*truncate
append()
10. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
=
print
argument variable
11. sets the file's current position
file.seek()
assignment
file.truncate()
def
12. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
insert()
<<
&
%s
13. An operator that removes a value from a list.
del
>
-=
n
14. Symbol to add things together
+
/=
argument variable
for
15. floor division AND assignment operator
len()
/=
//=
()
16. 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
>>
n
%
int
17. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
write
int
*
18. Modulus operator. It's the remainder after division
%d
in
%
:
19. The keyword beginning a header that will create a new function.
/
a//b
def
%s
20. modulus AND assignment operator
print
if
%=
while
21. prints its parameter to the console
=
str()
round()
print()
22. add AND assignment operator
=
/
+=
str()
23. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
read
a%b
readline
|
24. Symbol to multiply things
%r
raise
*
=
25. Prints a string to the screen which will be Unicode.
&
=
%s
.py
26. Greater than or equal symbol.
>=
read
%d
27. Create a variable.
==
print
read
=
28. Adds a new line character
n
#
&
%
29. Where the parameters go. A necessary punctuation after any function even if it's empty.
argv
close
in
()
30. turns an object into a string
close
//=
str()
^
31. 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.
argument variable
*
%r
in
32. turns an object into an integer
raise
a**b
int()
33. writes stuff to the file
try
file.write(stuff)
.py
pass
34. The extension for Python scripts
del
>
.py
for
35. A statement that ends the current iteration of a loop but continues looping.
%d
*truncate
continue
readline
36. 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
<<
print
int
37. prints its parameter to the console
print()
=
()
~
38. Symbol used to create comments
#
close
def
<<
39. unction to read one line of a file
readline
def
^
is
40. Function to read the contents of a file
:
str
while
read
41. square root
readline
else
:
math.sqrt(a)
42. Symbol to add things together
=
argv
a**b
+
43. This keyword begins a header for a body that repeats until the condition is no longer true.
read
while
class
*read
44. Symbol to subtract things from each other
in
=
-
readline
45. This keyword begins the simplest form of a conditional statement.
>=
if
**=
**=
46. 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.
+=
//=
not in
abs(a)
47. unction to read one line of a file
readline
>>
format string
<
48. Function to close a file - it will not be able to be used again unless the file is opened.
+=
<=
close
insert()
49. The keyword beginning a header that will create a loop.
for
file.seek()
^
open()
50. rounds a number to the number of decimal points you choose
class
round()
in
truncate