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. floor division AND assignment operator
//=
>
Variables
/=
2. exponentiation
*
Variables
>
a**b
3. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
%
<
~
print()
4. assignment operator
+
#
else
=
5. 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.
del
append()
<<
argument variable
6. Reads just one line of a text file.
~
()
/=
*readline
7. exponentiation
else
<<
a**b
len()
8. floor division
a//b
**=
format string
str()
9. This keyword begins the simplest form of a conditional statement.
file.seek()
()
//=
if
10. The extension for Python scripts
>=
.py
assignment
>>
11. turns an object into a string
a**b
str()
round()
floating point number
12. Greater than or equal symbol.
readline
print
/=
>=
13. Symbol used to create comments
a%b
#
del
print()
14. An operator that removes a value from a list.
*=
%
del
a**b
15. End header line.
print
del
#
:
16. Function to write something to a file
write
is not
**=
Variables
17. A logical operator which requires two expressions to both be true.
&
while
and
n
18. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
%r
in
while
Variables
19. divide AND assignment operator
append()
insert()
^
/=
20. Argument variable
del
argv
raise
round()
21. Symbol to multiply things
#
file.truncate()
%s
*
22. writes stuff to the file
file.write(stuff)
|
del
>
23. 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
^
file.seek()
print()
assignment
24. Command to print to the screen
len()
floating point number
%
print
25. modulus AND assignment operator
%=
open()
~
+=
26. ,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.
truncate
and
+
27. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
^
print()
-
class
28. turns an object into a string
and
*
.py
str()
29. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
close
abs(a)
+
try
30. reads just one line of a text file & keeps track of where in the file you're at
open()
file.readline()
+
%d
31. Less than or equal to symbol
<=
file.write(stuff)
is not
is
32. This keyword begins the simplest form of a conditional statement.
if
except
not
%r
33. This statement exits a function. The remaining lines of the function are not executed.
open()
()
break
return
34. Create a variable.
a**b
+=
open()
=
35. This keyword begins a header for a body that repeats until the condition is no longer true.
/
while
def
len()
36. add AND assignment operator
+=
%=
print
>
37. Prints a string to the screen which is a signed decimal.
%d
a//b
**=
floating point number
38. Prints a string to the screen which is converted using repr()
file.seek()
round()
write
%r
39. floor division AND assignment operator
+
>=
-=
//=
40. returns the length of a string (number of characters)
%r
len()
truncate
=
41. absolute value
abs(a)
raise
%r
>=
42. Symbol to divide by the number to the right of the symbol
>>
%r
&
/
43. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
str
abs(a)
truncate
~
44. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
print()
and
()
>=
45. Symbol to add things together
+
file.seek()
.py
input()
46. rounds a number to the number of decimal points you choose
#
math.sqrt(a)
round()
|
47. Prevents a runtime error from stopping the program.
:
del
except
*write(stuff)
48. asks the user for a response and returns that response
read
open()
^
input()
49. Modulus operator. It's the remainder after division
%
insert()
try
50. deletes an item from a list
del
file.seek()
/
: