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. Function to open or read a file
math.sqrt(a)
%r
open()
pass
2. Greater than or equal symbol.
%=
open()
>=
-=
3. writes stuff to the file
file.write(stuff)
>
argv
not in
4. Prints a string to the screen which is converted using repr()
a//b
%r
==
&
5. add AND assignment operator
file.write(stuff)
while
+=
round()
6. rounds a number to the number of decimal points you choose
not
<<
round()
argv
7. Prints a string to the screen which is a signed decimal.
or
%d
insert()
and
8. subtract AND assignment operator
-=
%r
elif (Else if)
in
9. Modulus operator. It's the remainder after division
math.sqrt(a)
%
read
return
10. This statement exits a function. The remaining lines of the function are not executed.
in
>>
return
def
11. Function to close a file - it will not be able to be used again unless the file is opened.
^
close
else
str()
12. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
break
&
-
close
13. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
%s
/
%=
try
14. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
**=
~
Variables
a%b
15. floor division
is
a//b
int()
=
16. Symbol to subtract things from each other
%r
not
-
int
17. End header line.
:
>
*
%d
18. 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.
~
break
abs(a)
argument variable
19. 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
append()
~
<<
.py
20. A built-in function that converts integers and strings to floating-point numbers.
abs(a)
float
*=
21. Argument variable
argv
+=
input()
a//b
22. subtract AND assignment operator
pass
str()
n
-=
23. Function to write something to a file
close
write
//=
str()
24. Symbol to add things together
+
=
a%b
insert()
25. Reads just one line of a text file.
*readline
if
floating point number
try
26. A built-in function that converts its argument to a string.
=
#
and
str
27. Greater than symbol
>
elif (Else if)
print()
continue
28. 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
^
=
%d
29. Empties the file - watch out if you care about the file.
*truncate
write
%s
int()
30. This keyword begins a header for a body that repeats until the condition is no longer true.
insert()
-
print
while
31. Symbol to add things together
+
>>
int()
and
32. Function to empty the contents of a file - no recovery is possible
truncate
()
/
=
33. Function to read the contents of a file
read
elif (Else if)
&
%d
34. absolute value
*=
abs(a)
%s
pass
35. floor division
if
while
a//b
len()
36. Function to close a file - it will not be able to be used again unless the file is opened.
assignment
close
//=
for
37. Create a variable.
=
()
del
-=
38. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
^
print()
.py
39. asks the user for a response and returns that response
input()
%s
def
abs(a)
40. divide AND assignment operator
print()
abs(a)
Variables
/=
41. Prints a string to the screen which is a signed decimal.
try
+=
%=
%d
42. A data type for representing numbers with fractional values.
floating point number
not
print()
*
43. Modulus operator. It's the remainder after division
else
close
%
del
44. floor division AND assignment operator
//=
%=
def
int()
45. modulo
<<
a%b
<
>
46. A logical operator which returns a value of True if either of the conditions is true.
/
<=
%=
or
47. exponent AND assignment operator
>=
=
**=
print()
48. modulus AND assignment operator
*=
%=
:
*write(stuff)
49. exponentiation
<
>>
a**b
for
50. This keyword in the body of a conditional allows chained conditionals.
float
elif (Else if)
close
a//b