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. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
else
Variables
/=
-
2. A statement that displays a value on the screen.
int
def
print
else
3. A logical operator which compares two operands and produces True if they are equal and False otherwise
*read
~
==
.py
4. Less than or equal to symbol
not
<=
**=
=
5. square root
a**b
math.sqrt(a)
print
elif (Else if)
6. Prevents a runtime error from stopping the program.
except
write
+
%
7. Modulus operator. It's the remainder after division
+=
print
%
<
8. A keyword that does nothing but fill space to indicate code which will be written later.
file.seek()
is
return
pass
9. The keyword beginning a header that will create a new function.
while
def
close
file.write(stuff)
10. exponent AND assignment operator
abs(a)
n
*=
**=
11. returns the length of a string (number of characters)
<=
len()
is not
a%b
12. Greater than symbol
open()
del
*read
>
13. divide AND assignment operator
/=
in
floating point number
=
14. Symbol to multiply things
**=
int
not in
*
15. This keyword begins the simplest form of a conditional statement.
if
except
open()
in
16. 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
-
<
%d
17. Reads the contents of the file you can assign the result to a variable.
*read
for
else
readline
18. assignment operator
=
append()
a%b
*read
19. divide AND assignment operator
/=
print
def
+
20. The extension for Python scripts
**=
.py
**=
<
21. Function to read the contents of a file
and
read
round()
while
22. Prints a string to the screen which is converted using repr()
**=
open()
%r
*readline
23. inserts an item inside a list at a certain index
insert()
%s
print()
=
24. Less than symbol
:
insert()
<
write
25. 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
read
+=
n
^
26. asks the user for a response and returns that response
while
input()
round()
*
27. A data type for representing numbers with fractional values.
floating point number
print
<
continue
28. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
*write(stuff)
del
and
format string
29. unction to read one line of a file
#
readline
abs(a)
<=
30. A logical operator which compares two operands and produces True if they are equal and False otherwise
%=
==
read
truncate
31. Command to print to the screen
**=
read
=
print
32. floor division AND assignment operator
argv
print()
/
//=
33. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
>>
*write(stuff)
~
input()
34. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
%r
-=
and
*
35. Adds something to a variable
int()
=
&
readline
36. This keyword in the body of a conditional - gives an alternative execution.
%s
int()
else
round()
37. Reads just one line of a text file.
except
%r
/=
*readline
38. Less than or equal to symbol
=
int()
<=
del
39. A statement that breaks out of a loop.
break
/
def
and
40. floor division
a//b
Variables
truncate
-
41. sets the file's current position
else
and
pass
file.seek()
42. Command to print to the screen
int()
file.write(stuff)
=
print
43. An operator to check whether two variables refer to the same object.
*=
is
close
44. Symbol to add things together
def
+
*
//=
45. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
write
^
int()
46. single line comment
input()
-=
-=
#
47. Function to open or read a file
-
read
assignment
open()
48. This keyword in the body of a conditional allows chained conditionals.
>=
del
elif (Else if)
=
49. add AND assignment operator
+=
float
while
else
50. Where the parameters go. A necessary punctuation after any function even if it's empty.
str()
^
()
math.sqrt(a)