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. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
<<
else
%r
2. Prints a string to the screen which is a signed decimal.
read
%d
raise
try
3. The keyword beginning a header that will create a new function.
assignment
:
*
def
4. Empties the file - watch out if you care about the file.
&
int()
<
*truncate
5. Writes stuff to the file.
=
~
*write(stuff)
6. This keyword in the body of a conditional allows chained conditionals.
math.sqrt(a)
elif (Else if)
append()
def
7. This keyword in the body of a conditional - gives an alternative execution.
else
write
break
~
8. prints its parameter to the console
math.sqrt(a)
()
#
print()
9. This keyword begins the simplest form of a conditional statement.
if
n
or
read
10. unction to read one line of a file
/=
format string
readline
*=
11. Symbol used to create comments
=
*=
#
round()
12. floor division
>=
a//b
=
+
13. unction to read one line of a file
readline
del
=
^
14. 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.
not in
+=
read
float
15. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
for
if
()
16. single line comment
while
for
#
format string
17. modulus AND assignment operator
-=
argv
%=
=
18. adds an item to a list
len()
append()
%=
read
19. rounds a number to the number of decimal points you choose
round()
%r
==
-
20. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
input()
class
and
*write(stuff)
21. The keyword beginning a header that will create a loop.
-
round()
insert()
for
22. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
%s
while
&
abs(a)
23. assignment operator
=
<=
%
pass
24. The extension for Python scripts
>=
.py
()
25. 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
>>
readline
class
elif (Else if)
26. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
Variables
in
.py
truncate
27. deletes an item from a list
%=
del
<
Variables
28. add AND assignment operator
math.sqrt(a)
>
+=
*readline
29. Function to write something to a file
argv
*write(stuff)
write
#
30. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
input()
while
n
31. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
a**b
n
%=
Variables
32. Turns a line into a comment instead of executable code.
%d
int()
%s
#
33. modulo
a%b
float
>=
class
34. Command to print to the screen
argv
print
math.sqrt(a)
+=
35. This keyword in the body of a conditional - gives an alternative execution.
:
len()
else
-=
36. divide AND assignment operator
%=
<=
/=
readline
37. adds an item to a list
/
if
append()
a//b
38. square root
math.sqrt(a)
if
in
read
39. exponent AND assignment operator
math.sqrt(a)
continue
*=
**=
40. returns the length of a string (number of characters)
len()
int()
>>
read
41. prints its parameter to the console
while
file.seek()
print()
%r
42. absolute value
%=
=
abs(a)
+
43. Adds a new line character
except
class
<=
n
44. Argument variable
insert()
argv
and
else
45. Prints a string to the screen which will be Unicode.
%
%s
**=
n
46. A logical operator which returns a value of True if either of the conditions is true.
<
or
except
file.truncate()
47. modulus AND assignment operator
%=
except
read
input()
48. 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
format string
a**b
49. Function to write something to a file
write
truncate
.py
return
50. turns an object into an integer
int()
//=
open()
.py