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. Modulus operator. It's the remainder after division
*
#
file.write(stuff)
%
2. Function to close a file - it will not be able to be used again unless the file is opened.
insert()
==
>
close
3. Prints a string to the screen which is a signed decimal.
print
%
print
%d
4. Turns a line into a comment instead of executable code.
#
argument variable
if
del
5. Argument variable
>=
argv
/=
#
6. Adds something to a variable
-=
if
~
=
7. This keyword in the body of a conditional - gives an alternative execution.
:
%d
else
*read
8. Where the parameters go. A necessary punctuation after any function even if it's empty.
in
*readline
<=
()
9. Symbol to subtract things from each other
str()
-
int()
open()
10. This keyword in the body of a conditional - gives an alternative execution.
append()
%=
else
a%b
11. Create a variable.
int()
=
math.sqrt(a)
a%b
12. Less than or equal to symbol
if
<=
print
file.seek()
13. 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.
%s
Variables
if
in
14. This keyword begins a header for a body that repeats until the condition is no longer true.
abs(a)
()
%d
while
15. modulus AND assignment operator
del
=
break
%=
16. add AND assignment operator
/
<=
+=
()
17. empties the file
~
file.truncate()
/=
del
18. adds an item to a list
assignment
>=
append()
len()
19. Reads the contents of the file you can assign the result to a variable.
a**b
abs(a)
input()
*read
20. The keyword beginning a header that will create a loop.
for
if
-=
21. Function to open or read a file
n
open()
/=
return
22. exponentiation
break
if
raise
a**b
23. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
abs(a)
*
-=
24. 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
<<
floating point number
=
int()
25. 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
-
^
%s
argv
26. unction to read one line of a file
readline
a%b
/
and
27. An operator that removes a value from a list.
def
class
a//b
del
28. 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.
%r
return
*
argument variable
29. Create a variable.
print()
=
else
:
30. A logical operator which requires two expressions to both be true.
round()
try
and
int
31. Function to empty the contents of a file - no recovery is possible
%
truncate
continue
insert()
32. The keyword beginning a header that will create a new function.
try
not
file.seek()
def
33. Less than or equal to symbol
<=
close
del
#
34. single line comment
or
/=
<=
#
35. assignment operator
&
=
:
36. subtract AND assignment operator
|
print
-=
break
37. modulo
<
argument variable
a%b
n
38. This keyword in the body of a conditional allows chained conditionals.
assignment
elif (Else if)
except
round()
39. A logical operator which negates an expression so that it returns a value of True if the expression is false.
.py
~
del
not
40. floor division AND assignment operator
%r
//=
str()
|
41. Symbol to add things together
format string
else
+
|
42. Reads just one line of a text file.
*readline
%r
%d
*truncate
43. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
=
*=
-
Variables
44. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
else
%d
*=
45. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
~
:
str()
46. turns an object into an integer
int()
*truncate
format string
^
47. sets the file's current position
abs(a)
=
file.seek()
read
48. Greater than or equal symbol.
assignment
>=
=
is not
49. Prints a string to the screen which is a signed decimal.
>=
len()
%d
math.sqrt(a)
50. Adds a new line character
n
len()
Variables
+=