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. Less than symbol
<
%s
+
class
2. unction to read one line of a file
float
/=
readline
-
3. asks the user for a response and returns that response
read
input()
%s
*read
4. This keyword in the body of a conditional - gives an alternative execution.
assignment
and
is not
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.
argument variable
insert()
==
math.sqrt(a)
6. returns the length of a string (number of characters)
is
+=
len()
abs(a)
7. Less than or equal to symbol
#
round()
*readline
<=
8. Less than symbol
math.sqrt(a)
*truncate
<
append()
9. Argument variable
#
if
%d
argv
10. Prints a string to the screen which is converted using repr()
math.sqrt(a)
%r
file.write(stuff)
&
11. subtract AND assignment operator
*=
-=
=
file.seek()
12. This statement exits a function. The remaining lines of the function are not executed.
n
~
print()
return
13. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
|
.py
^
14. empties the file
round()
in
file.truncate()
=
15. Function to write something to a file
:
write
()
~
16. divide AND assignment operator
close
insert()
int()
/=
17. This keyword in the body of a conditional - gives an alternative execution.
-
open()
else
**=
18. Function to open or read a file
<=
()
open()
<
19. 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.
-
str
=
in
20. This statement causes an exception.
in
len()
raise
21. Command to print to the screen
math.sqrt(a)
print
read
%s
22. turns an object into an integer
round()
print
*truncate
int()
23. sets the file's current position
file.seek()
if
return
a//b
24. The keyword beginning a header that will create a loop.
print()
file.readline()
for
-=
25. An operator that removes a value from a list.
#
del
<=
**=
26. Modulus operator. It's the remainder after division
=
%
>=
print
27. A logical operator which returns a value of True if either of the conditions is true.
+=
|
or
input()
28. reads just one line of a text file & keeps track of where in the file you're at
if
file.readline()
continue
append()
29. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
truncate
&
len()
%
30. square root
a//b
*
math.sqrt(a)
else
31. A keyword that does nothing but fill space to indicate code which will be written later.
file.readline()
abs(a)
<
pass
32. modulus AND assignment operator
%=
del
=
continue
33. Prints a string to the screen which is a signed decimal.
write
-
#
%d
34. floor division
/
==
in
a//b
35. Prevents a runtime error from stopping the program.
argv
int
except
<
36. Function to read the contents of a file
/=
read
assignment
%d
37. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
read
except
:
38. 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
^
not in
:
%=
39. Greater than or equal symbol.
else
close
**=
>=
40. Symbol to subtract things from each other
-
len()
is not
=
41. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
file.truncate()
-
|
/=
42. modulo
*write(stuff)
a%b
a//b
+
43. Turns a line into a comment instead of executable code.
int()
del
#
44. adds an item to a list
write
append()
file.write(stuff)
^
45. Empties the file - watch out if you care about the file.
=
*truncate
+
%=
46. writes stuff to the file
format string
file.write(stuff)
if
abs(a)
47. This keyword begins the simplest form of a conditional statement.
<
continue
if
file.seek()
48. A data type for representing numbers with fractional values.
argument variable
floating point number
/
*truncate
49. Symbol to multiply things
int
*
a%b
Variables
50. End header line.
else
:
#
argv