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. This keyword begins the simplest form of a conditional statement.
append()
%=
if
round()
2. The keyword beginning a header that will create a loop.
*=
for
continue
return
3. Symbol used to create comments
round()
#
-=
a%b
4. A data type for representing numbers with fractional values.
open()
^
+
floating point number
5. Less than symbol
floating point number
+
<
if
6. Function to empty the contents of a file - no recovery is possible
for
assignment
truncate
print()
7. unction to read one line of a file
~
append()
readline
**=
8. Symbol used to create comments
#
%r
&
+
9. A statement that assigns a value to a variable.
readline
insert()
assignment
input()
10. writes stuff to the file
abs(a)
del
for
file.write(stuff)
11. turns an object into an integer
int()
del
argv
.py
12. Function to close a file - it will not be able to be used again unless the file is opened.
close
while
*truncate
Variables
13. Prints a string to the screen which will be Unicode.
try
%s
+
or
14. add AND assignment operator
=
+=
math.sqrt(a)
*
15. Function to write something to a file
%s
write
*truncate
*read
16. Symbol to multiply things
is
*
else
%d
17. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
#
&
-=
else
18. Function to close a file - it will not be able to be used again unless the file is opened.
//=
close
while
abs(a)
19. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
/=
write
try
//=
20. 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
<<
is
=
//=
21. A built-in function that converts its argument to a string.
str
n
>=
print()
22. End header line.
not
:
Variables
^
23. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.
else
not in
a//b
%s
24. A logical operator which compares two operands and produces True if they are equal and False otherwise
-=
~
assignment
==
25. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
class
<
/=
26. modulo
a%b
in
del
.py
27. divide AND assignment operator
%d
-
file.readline()
/=
28. divide AND assignment operator
print
file.readline()
return
/=
29. Function to read the contents of a file
+=
=
*=
read
30. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
insert()
*write(stuff)
format string
#
31. returns the length of a string (number of characters)
<<
-
*read
len()
32. This keyword in the body of a conditional allows chained conditionals.
*=
elif (Else if)
>
try
33. Less than symbol
<
float
:
del
34. Adds something to a variable
for
=
+
()
35. Symbol to divide by the number to the right of the symbol
/
except
abs(a)
readline
36. modulo
a%b
if
print()
()
37. exponent AND assignment operator
Variables
**=
()
*truncate
38. Create a variable.
*
=
-
/
39. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
print()
()
/
class
40. turns an object into an integer
-=
int()
~
|
41. prints its parameter to the console
is
print()
*
file.truncate()
42. Function to open or read a file
open()
|
-=
Variables
43. floor division AND assignment operator
.py
<
//=
float
44. A built-in function that converts integers and strings to floating-point numbers.
input()
int()
readline
float
45. Function to open or read a file
int()
except
in
open()
46. Adds a new line character
append()
n
in
open()
47. Prevents a runtime error from stopping the program.
close
>=
&
except
48. subtract AND assignment operator
Variables
-=
except
file.write(stuff)
49. 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
def
<=
^
str
50. Writes stuff to the file.
*write(stuff)
*
readline
print