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.
readline
def
*truncate
readline
2. prints its parameter to the console
print()
file.truncate()
write
abs(a)
3. Function to close a file - it will not be able to be used again unless the file is opened.
while
*write(stuff)
a**b
close
4. floor division
*=
and
^
a//b
5. Less than or equal to symbol
**=
<=
*read
~
6. Prints a string to the screen which is a signed decimal.
break
+=
%d
%s
7. Modulus operator. It's the remainder after division
in
<
read
%
8. This statement causes an exception.
+=
^
raise
file.seek()
9. 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
^
in
+=
n
10. square root
a%b
continue
append()
math.sqrt(a)
11. empties the file
file.truncate()
-=
read
print
12. subtract AND assignment operator
**=
print
-=
is
13. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).
is not
/=
int()
for
14. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
else
%r
^
15. 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
|
>>
open()
file.seek()
16. turns an object into a string
str()
readline
&
>>
17. adds an item to a list
a**b
append()
=
elif (Else if)
18. Symbol to multiply things
len()
or
*
abs(a)
19. A statement that displays a value on the screen.
#
close
a%b
print
20. Empties the file - watch out if you care about the file.
*truncate
()
%=
del
21. exponent AND assignment operator
<=
argv
int
**=
22. Symbol to subtract things from each other
%
-
round()
abs(a)
23. The keyword beginning a header that will create a loop.
-=
=
for
file.readline()
24. modulo
read
==
read
a%b
25. Argument variable
argv
-=
a//b
if
26. Prints a string to the screen which will be Unicode.
not
+=
int()
%s
27. 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
%=
>>
open()
28. Symbol to divide by the number to the right of the symbol
for
/
%d
except
29. returns the length of a string (number of characters)
&
len()
and
print()
30. deletes an item from a list
del
*=
except
<<
31. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
len()
==
continue
32. Argument variable
if
print
argv
>
33. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.
n
%
n
34. 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.
//=
open()
open()
argument variable
35. multiply AND assignment operator
a%b
input()
*=
*read
36. modulo
a%b
print
and
-=
37. A keyword that does nothing but fill space to indicate code which will be written later.
is
pass
/
append()
38. Adds something to a variable
a**b
str()
&
=
39. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
+
class
=
print
40. Greater than symbol
round()
=
>
abs(a)
41. A data type for representing numbers with fractional values.
floating point number
:
float
#
42. Symbol to add things together
insert()
+=
+
%r
43. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
or
Variables
<<
float
44. Where the parameters go. A necessary punctuation after any function even if it's empty.
assignment
=
a**b
()
45. sets the file's current position
*=
continue
+=
file.seek()
46. Less than or equal to symbol
in
round()
<=
:
47. asks the user for a response and returns that response
write
else
input()
=
48. Less than symbol
>=
file.write(stuff)
<
#
49. A built-in function that converts its argument to a string.
except
**=
str
>=
50. subtract AND assignment operator
del
.py
for
-=