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 attempts to do something that would cause the program to crash if it were not for this statement.
raise
>=
try
if
2. Symbol to add things together
=
+
insert()
=
3. turns an object into a string
def
*
#
str()
4. Create a variable.
print
=
if
for
5. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
>=
abs(a)
len()
6. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
*=
*=
int
<
7. Symbol used to create comments
read
#
>
**=
8. 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
^
continue
=
#
9. returns the length of a string (number of characters)
<=
a//b
abs(a)
len()
10. Function to read the contents of a file
%r
read
#
=
11. Prints a string to the screen which is converted using repr()
input()
n
%r
is
12. turns an object into a string
len()
%s
=
str()
13. The keyword beginning a header that will create a new function.
def
%r
*=
a**b
14. divide AND assignment operator
print()
str()
~
/=
15. An operator that removes a value from a list.
del
a%b
def
<<
16. Function to open or read a file
%s
open()
abs(a)
int
17. floor division AND assignment operator
=
math.sqrt(a)
<=
//=
18. Function to close a file - it will not be able to be used again unless the file is opened.
and
-
del
close
19. This keyword in the body of a conditional allows chained conditionals.
file.write(stuff)
in
<<
elif (Else if)
20. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
=
pass
n
21. inserts an item inside a list at a certain index
insert()
*readline
open()
22. Function to close a file - it will not be able to be used again unless the file is opened.
def
close
+
a%b
23. add AND assignment operator
-
+=
else
<<
24. The extension for Python scripts
%s
>=
.py
*
25. returns the length of a string (number of characters)
=
len()
*
<=
26. reads just one line of a text file & keeps track of where in the file you're at
:
>>
not
file.readline()
27. The keyword beginning a header that will create a new function.
pass
>>
def
format string
28. Reads just one line of a text file.
-=
truncate
-=
*readline
29. exponent AND assignment operator
<
**=
close
&
30. Prints a string to the screen which will be Unicode.
-=
%s
+
#
31. turns an object into an integer
write
+=
int()
insert()
32. Prints a string to the screen which is a signed decimal.
+
|
file.truncate()
%d
33. absolute value
abs(a)
:
break
<=
34. Adds something to a variable
file.write(stuff)
=
str()
.py
35. Where the parameters go. A necessary punctuation after any function even if it's empty.
/
insert()
()
.py
36. Greater than symbol
is
int()
>
()
37. An operator to check whether two variables refer to the same object.
str()
%
>
is
38. Symbol to subtract things from each other
%=
elif (Else if)
-
-=
39. Less than or equal to symbol
*
elif (Else if)
<=
int()
40. subtract AND assignment operator
math.sqrt(a)
readline
+
-=
41. Less than symbol
**=
.py
#
<
42. A logical operator which compares two operands and produces True if they are equal and False otherwise
//=
del
close
==
43. 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.
+=
()
-=
argument variable
44. modulus AND assignment operator
%=
|
*write(stuff)
**=
45. multiply AND assignment operator
close
else
Variables
*=
46. A logical operator which requires two expressions to both be true.
and
input()
floating point number
print
47. The keyword beginning a header that will create a loop.
~
*write(stuff)
and
for
48. adds an item to a list
append()
%r
-
try
49. Adds a new line character
int
n
a**b
50. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
print()
**=
&
//=