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 extension for Python scripts
is
%s
.py
not in
2. ,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.
not in
print
>=
3. This statement causes an exception.
raise
=
if
def
4. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
read
/
def
5. multiply AND assignment operator
truncate
truncate
not
*=
6. Less than or equal to symbol
float
<=
Variables
input()
7. 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
and
^
.py
truncate
8. End header line.
file.write(stuff)
print()
open()
:
9. Turns a line into a comment instead of executable code.
read
#
<
.py
10. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
-
and
#
%
11. Function to close a file - it will not be able to be used again unless the file is opened.
file.write(stuff)
**=
close
~
12. A statement that displays a value on the screen.
%s
//=
print
|
13. Greater than or equal symbol.
int()
=
abs(a)
>=
14. single line comment
+
#
int()
append()
15. floor division
>>
==
<<
a//b
16. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
<
|
print
-
17. 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
%r
18. Prevents a runtime error from stopping the program.
.py
not
#
except
19. Command to print to the screen
float
print
.py
math.sqrt(a)
20. A keyword that does nothing but fill space to indicate code which will be written later.
pass
del
argv
21. An operator to check whether two variables refer to the same object.
del
~
is
float
22. unction to read one line of a file
readline
==
a%b
^
23. 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
write
is
close
>>
24. Adds something to a variable
>
&
class
=
25. A logical operator which returns a value of True if either of the conditions is true.
~
or
insert()
%
26. Greater than symbol
*
%=
>
+=
27. Symbol to multiply things
*
del
else
int
28. Prints a string to the screen which is a signed decimal.
:
+
%d
len()
29. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
open()
*write(stuff)
int
()
30. Function to close a file - it will not be able to be used again unless the file is opened.
input()
()
*
close
31. returns the length of a string (number of characters)
%d
/=
for
len()
32. inserts an item inside a list at a certain index
insert()
for
open()
str()
33. deletes an item from a list
math.sqrt(a)
del
*readline
in
34. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
+=
^
Variables
append()
35. divide AND assignment operator
argv
+
/=
.py
36. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
*readline
>>
.py
Variables
37. Function to open or read a file
return
**=
open()
str
38. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
try
.py
file.seek()
-=
39. A logical operator which negates an expression so that it returns a value of True if the expression is false.
<<
%r
Variables
not
40. turns an object into an integer
*write(stuff)
int()
#
%d
41. Prints a string to the screen which is converted using repr()
if
%r
*read
()
42. Where the parameters go. A necessary punctuation after any function even if it's empty.
del
()
+
a//b
43. This keyword begins the simplest form of a conditional statement.
*
assignment
if
print
44. Adds something to a variable
^
continue
//=
=
45. Symbol to multiply things
*
for
int()
truncate
46. Greater than or equal symbol.
>=
file.readline()
>>
elif (Else if)
47. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
*
%r
//=
~
48. absolute value
truncate
**=
abs(a)
n
49. A built-in function that converts integers and strings to floating-point numbers.
abs(a)
|
/
float
50. Symbol to add things together
+
class
math.sqrt(a)
del