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 statement causes an exception.
^
insert()
raise
#
2. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
close
%r
len()
Variables
3. Symbol to subtract things from each other
math.sqrt(a)
-
print
=
4. Less than symbol
argument variable
truncate
<
truncate
5. A logical operator which requires two expressions to both be true.
close
elif (Else if)
floating point number
and
6. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
print
str()
a//b
in
7. Less than or equal to symbol
and
<=
except
continue
8. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
write
break
<=
9. Argument variable
open()
>
argv
else
10. prints its parameter to the console
argv
print()
except
|
11. assignment operator
=
+=
+
12. empties the file
file.truncate()
del
int()
print()
13. 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
14. Adds a new line character
=
if
n
-=
15. floor division AND assignment operator
argv
print()
//=
*readline
16. The keyword beginning a header that will create a new function.
a%b
def
else
format string
17. An operator to check whether two variables refer to the same object.
|
==
is
18. multiply AND assignment operator
|
|
.py
*=
19. This statement exits a function. The remaining lines of the function are not executed.
=
+
return
while
20. Symbol to add things together
def
argv
+
a**b
21. Function to write something to a file
except
print
argv
write
22. This keyword begins the simplest form of a conditional statement.
%s
%=
math.sqrt(a)
if
23. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
else
format string
insert()
=
24. inserts an item inside a list at a certain index
insert()
or
str()
()
25. exponent AND assignment operator
+
**=
>
/=
26. Function to empty the contents of a file - no recovery is possible
truncate
a%b
#
for
27. Modulus operator. It's the remainder after division
%
print
continue
>=
28. 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.
while
in
#
round()
29. Function to empty the contents of a file - no recovery is possible
*
truncate
==
**=
30. turns an object into a string
if
raise
str()
>
31. Prevents a runtime error from stopping the program.
<
print
argv
except
32. This keyword begins the simplest form of a conditional statement.
==
if
while
close
33. Symbol to subtract things from each other
#
%=
-
|
34. This keyword in the body of a conditional - gives an alternative execution.
def
for
-
else
35. absolute value
input()
abs(a)
<
#
36. unction to read one line of a file
readline
close
file.truncate()
if
37. Prints a string to the screen which will be Unicode.
/=
open()
%s
print()
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
print
file.readline()
^
==
39. floor division
a//b
==
**=
print
40. The keyword beginning a header that will create a new function.
&
def
for
len()
41. A logical operator which compares two operands and produces True if they are equal and False otherwise
>
#
==
and
42. End header line.
=
:
read
&
43. Symbol to multiply things
truncate
*
&
print
44. 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
|
45. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
continue
def
while
46. turns an object into an integer
and
%s
write
int()
47. modulus AND assignment operator
str()
%=
int
and
48. Symbol used to create comments
argument variable
argv
#
>>
49. Argument variable
a**b
not in
close
argv
50. Function to open or read a file
round()
input()
open()
return