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 attempts to do something that would cause the program to crash if it were not for this statement.
.py
try
str()
argv
2. asks the user for a response and returns that response
input()
write
print()
truncate
3. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.
in
<
Variables
abs(a)
4. Adds something to a variable
=
%=
assignment
/=
5. absolute value
-
str()
abs(a)
**=
6. Function to open or read a file
*readline
break
open()
>
7. 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.
%
in
()
not in
8. floor division AND assignment operator
a%b
def
int()
//=
9. Command to print to the screen
%=
print
readline
del
10. deletes an item from a list
del
*readline
|
insert()
11. writes stuff to the file
close
*read
file.write(stuff)
close
12. unction to read one line of a file
truncate
readline
a//b
*=
13. A logical operator which returns a value of True if either of the conditions is true.
()
a//b
or
del
14. Symbol used to create comments
*=
%d
round()
#
15. Symbol to multiply things
|
print
*
-
16. Function to empty the contents of a file - no recovery is possible
round()
print
truncate
n
17. multiply AND assignment operator
*=
.py
str()
file.readline()
18. exponentiation
a**b
+
n
math.sqrt(a)
19. The keyword beginning a header that will create a loop.
del
for
n
close
20. Reads the contents of the file you can assign the result to a variable.
*read
floating point number
for
insert()
21. A statement that assigns a value to a variable.
%d
assignment
=
*write(stuff)
22. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
*=
in
else
a%b
23. exponent AND assignment operator
**=
a%b
^
file.truncate()
24. floor division AND assignment operator
floating point number
%r
//=
insert()
25. absolute value
else
abs(a)
int()
not
26. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
-=
int()
Variables
#
27. Writes stuff to the file.
write
:
floating point number
*write(stuff)
28. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
is
file.readline()
|
readline
29. A statement that breaks out of a loop.
len()
^
break
=
30. exponentiation
a**b
&
int()
%=
31. adds an item to a list
if
&
:
append()
32. Where the parameters go. A necessary punctuation after any function even if it's empty.
&
a**b
^
()
33. asks the user for a response and returns that response
=
//=
input()
=
34. modulus AND assignment operator
==
%=
:
file.truncate()
35. Adds a new line character
not in
+
n
elif (Else if)
36. Adds a new line character
n
==
/=
elif (Else if)
37. Function to read the contents of a file
a%b
a**b
def
read
38. modulus AND assignment operator
argv
*write(stuff)
+
%=
39. Symbol to subtract things from each other
-
readline
%=
readline
40. End header line.
*readline
:
%
or
41. This keyword in the body of a conditional - gives an alternative execution.
else
del
assignment
Variables
42. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
close
is not
while
43. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
math.sqrt(a)
#
print
44. empties the file
>=
file.truncate()
/
&
45. Argument variable
in
print
argv
#
46. floor division
/=
a//b
input()
del
47. 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
def
>>
48. Prevents a runtime error from stopping the program.
except
and
append()
=
49. Prints a string to the screen which is a signed decimal.
file.write(stuff)
and
%d
a//b
50. rounds a number to the number of decimal points you choose
try
==
argv
round()