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 in the body of a conditional allows chained conditionals.
/
elif (Else if)
del
~
2. 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
&
read
3. The keyword beginning a header that will create a new function.
*
*readline
def
:
4. turns an object into an integer
=
for
int()
Variables
5. subtract AND assignment operator
len()
*readline
-=
del
6. Function to open or read a file
file.seek()
raise
round()
open()
7. Prevents a runtime error from stopping the program.
%r
except
>=
or
8. reads just one line of a text file & keeps track of where in the file you're at
>
file.readline()
%
Variables
9. Symbol to add things together
argv
if
+
or
10. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
open()
Variables
len()
except
11. empties the file
.py
=
file.truncate()
*
12. This keyword begins the simplest form of a conditional statement.
int()
file.truncate()
if
.py
13. turns an object into an integer
int()
*truncate
open()
append()
14. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
if
:
or
15. End header line.
:
*=
round()
|
16. This keyword in the body of a conditional - gives an alternative execution.
else
~
del
and
17. rounds a number to the number of decimal points you choose
round()
argv
==
()
18. Modulus operator. It's the remainder after division
%
elif (Else if)
:
>=
19. 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
^
file.write(stuff)
insert()
/
20. A logical operator which compares two operands and produces True if they are equal and False otherwise
or
==
-
append()
21. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
>
class
22. 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
>>
~
close
print
23. This keyword begins a header for a body that repeats until the condition is no longer true.
while
^
file.write(stuff)
%=
24. assignment operator
%=
=
for
argument variable
25. 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
#
%d
%=
26. multiply AND assignment operator
in
*=
>=
>=
27. Symbol used to create comments
#
close
%r
write
28. 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
insert()
float
or
>>
29. deletes an item from a list
==
del
*truncate
print()
30. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
write
&
continue
input()
31. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
<<
in
continue
else
32. multiply AND assignment operator
round()
*=
+=
is not
33. Adds something to a variable
**=
print
=
%s
34. Create a variable.
assignment
a//b
%s
=
35. This keyword begins the simplest form of a conditional statement.
if
class
str()
*=
36. Where the parameters go. A necessary punctuation after any function even if it's empty.
close
def
()
str()
37. A logical operator which requires two expressions to both be true.
and
if
a**b
%
38. A statement that breaks out of a loop.
+
.py
break
<<
39. An operator that removes a value from a list.
-=
del
%=
readline
40. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
or
|
Variables
*=
41. absolute value
else
Variables
n
abs(a)
42. This statement exits a function. The remaining lines of the function are not executed.
return
round()
-=
assignment
43. Reads just one line of a text file.
=
*readline
()
class
44. prints its parameter to the console
-
print()
<
%d
45. 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
~
>
file.truncate()
<<
46. modulus AND assignment operator
%=
|
else
argv
47. exponentiation
a**b
readline
^
>=
48. A built-in function that converts integers and strings to floating-point numbers.
round()
>>
float
append()
49. A data type for representing numbers with fractional values.
*
print()
floating point number
%=
50. sets the file's current position
insert()
#
file.seek()
-=