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. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
insert()
in
+=
input()
2. Less than symbol
<
assignment
readline
abs(a)
3. A statement that breaks out of a loop.
round()
math.sqrt(a)
&
break
4. unction to read one line of a file
math.sqrt(a)
readline
%s
print
5. Prints a string to the screen which is a signed decimal.
%d
round()
elif (Else if)
for
6. Function to open or read a file
=
del
open()
round()
7. End header line.
Variables
truncate
:
*readline
8. The keyword beginning a header that will create a loop.
if
while
>
for
9. divide AND assignment operator
/=
else
def
>>
10. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
int()
insert()
in
11. absolute value
a//b
%d
abs(a)
file.truncate()
12. Symbol to multiply things
%
*
for
and
13. A logical operator which compares two operands and produces True if they are equal and False otherwise
>=
=
==
else
14. This keyword begins the simplest form of a conditional statement.
if
print()
%s
a**b
15. add AND assignment operator
+=
>=
=
str()
16. assignment operator
=
try
file.readline()
*write(stuff)
17. turns an object into a string
/
str()
=
continue
18. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
-=
/=
()
19. returns the length of a string (number of characters)
%d
print()
len()
del
20. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
.py
%d
raise
21. This keyword in the body of a conditional - gives an alternative execution.
not
~
else
~
22. turns an object into an integer
int()
input()
round()
n
23. Adds a new line character
input()
*
str()
n
24. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
or
insert()
and
%s
25. Function to empty the contents of a file - no recovery is possible
truncate
round()
n
%
26. Function to open or read a file
int
open()
for
read
27. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
argv
Variables
*readline
%
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
or
^
class
else
29. adds an item to a list
/
append()
Variables
~
30. 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.
|
in
return
math.sqrt(a)
31. absolute value
<<
abs(a)
in
**=
32. subtract AND assignment operator
-=
del
open()
assignment
33. A built-in function that converts integers and strings to floating-point numbers.
|
float
%s
elif (Else if)
34. floor division AND assignment operator
()
//=
argument variable
~
35. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
input()
^
*read
Variables
36. floor division
a//b
file.truncate()
is not
%s
37. A logical operator which returns a value of True if either of the conditions is true.
%d
math.sqrt(a)
or
raise
38. The keyword beginning a header that will create a loop.
^
for
**=
==
39. asks the user for a response and returns that response
/
input()
del
truncate
40. Function to read the contents of a file
for
read
else
a%b
41. Reads just one line of a text file.
*readline
/=
truncate
return
42. modulus AND assignment operator
a**b
#
%=
>
43. Prints a string to the screen which is converted using repr()
str()
%r
insert()
**=
44. Symbol to divide by the number to the right of the symbol
/
#
+=
<=
45. 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
del
%s
^
**=
46. The extension for Python scripts
insert()
n
.py
=
47. A data type for representing numbers with fractional values.
else
%=
floating point number
>=
48. A keyword that does nothing but fill space to indicate code which will be written later.
int()
/=
pass
floating point number
49. ,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.
print
>>
%=
50. subtract AND assignment operator
-=
close
print()
del