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 keyword beginning a header that will create a new function.
def
+=
break
while
2. 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.
-=
round()
not in
=
3. inserts an item inside a list at a certain index
+
except
%r
insert()
4. modulus AND assignment operator
int()
%=
a%b
class
5. Less than or equal to symbol
<=
write
*readline
format string
6. multiply AND assignment operator
argument variable
+
*=
%=
7. This keyword begins a header for a body that repeats until the condition is no longer true.
while
append()
close
and
8. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
read
=
class
len()
9. Prints a string to the screen which is a signed decimal.
a//b
print()
%d
readline
10. Function to open or read a file
argv
input()
open()
a**b
11. absolute value
*
abs(a)
<
**=
12. assignment operator
.py
read
=
in
13. Symbol to subtract things from each other
-
n
format string
&
14. asks the user for a response and returns that response
input()
/=
-=
<<
15. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
a**b
close
in
assignment
16. An operator that removes a value from a list.
math.sqrt(a)
del
+
%s
17. writes stuff to the file
*read
int()
%=
file.write(stuff)
18. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
argument variable
Variables
//=
readline
19. The keyword beginning a header that will create a loop.
if
and
%
for
20. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
#
|
readline
>>
21. unction to read one line of a file
%
%s
readline
del
22. Prevents a runtime error from stopping the program.
str()
floating point number
except
**=
23. A logical operator which returns a value of True if either of the conditions is true.
continue
or
if
^
24. floor division AND assignment operator
**=
//=
insert()
close
25. Symbol to subtract things from each other
%r
-
read
>>
26. A data type for representing numbers with fractional values.
len()
<
<
floating point number
27. 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
pass
<<
a%b
class
28. Symbol to multiply things
read
*=
*
//=
29. Function to open or read a file
print()
-=
continue
open()
30. Less than symbol
abs(a)
+
^
<
31. Less than symbol
==
int()
<
^
32. A statement that displays a value on the screen.
^
else
print
+
33. Empties the file - watch out if you care about the file.
%
int
*truncate
*
34. turns an object into an integer
is not
()
int()
read
35. turns an object into a string
str()
:
-
float
36. divide AND assignment operator
:
is
/=
*read
37. 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
^
*readline
#
del
38. Function to read the contents of a file
=
int()
<<
read
39. turns an object into a string
|
a**b
str()
while
40. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
*
for
try
+=
41. Adds a new line character
n
floating point number
#
~
42. Function to empty the contents of a file - no recovery is possible
a//b
continue
#
truncate
43. Symbol to add things together
~
+
print()
not in
44. Command to print to the screen
*
print
-
<
45. 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.
argv
int()
class
argument variable
46. modulo
floating point number
a%b
read
+=
47. returns the length of a string (number of characters)
in
not
int()
len()
48. asks the user for a response and returns that response
=
%=
>
input()
49. Symbol used to create comments
#
len()
>
<=
50. subtract AND assignment operator
abs(a)
-=
=
>