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. Symbol to add things together
del
+
open()
file.write(stuff)
2. modulus AND assignment operator
*=
%=
<<
print
3. Create a variable.
a//b
^
=
return
4. This keyword in the body of a conditional - gives an alternative execution.
else
>>
math.sqrt(a)
int()
5. Adds something to a variable
=
-=
<<
open()
6. returns the length of a string (number of characters)
elif (Else if)
format string
len()
()
7. The keyword beginning a header that will create a new function.
#
#
def
except
8. Symbol used to create comments
#
a%b
format string
truncate
9. returns the length of a string (number of characters)
len()
n
^
>>
10. modulo
int()
a%b
math.sqrt(a)
a**b
11. This keyword begins the simplest form of a conditional statement.
if
%s
assignment
&
12. Reads the contents of the file you can assign the result to a variable.
*read
-
~
str
13. Symbol to add things together
input()
del
+
^
14. This keyword in the body of a conditional allows chained conditionals.
in
for
a//b
elif (Else if)
15. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
=
is
len()
16. Prints a string to the screen which is a signed decimal.
a%b
~
%d
=
17. 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
not
in
^
n
18. absolute value
str()
read
abs(a)
and
19. reads just one line of a text file & keeps track of where in the file you're at
str()
float
else
file.readline()
20. End header line.
:
class
=
/
21. asks the user for a response and returns that response
>=
input()
~
>
22. deletes an item from a list
write
del
=
%d
23. Command to print to the screen
print
:
<=
in
24. floor division
a//b
for
open()
*
25. Prints a string to the screen which is a signed decimal.
==
close
read
%d
26. assignment operator
=
if
*write(stuff)
>>
27. square root
n
insert()
*read
math.sqrt(a)
28. unction to read one line of a file
>
readline
argument variable
29. A data type for representing numbers with fractional values.
=
floating point number
>>
*write(stuff)
30. subtract AND assignment operator
-=
+=
-
return
31. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
-
Variables
=
#
32. writes stuff to the file
abs(a)
%r
=
file.write(stuff)
33. turns an object into an integer
>
int()
a**b
%=
34. An operator that removes a value from a list.
del
*read
%s
str
35. Empties the file - watch out if you care about the file.
%d
truncate
<
*truncate
36. Prints a string to the screen which is converted using repr()
//=
%r
str
readline
37. floor division AND assignment operator
file.seek()
//=
*write(stuff)
a**b
38. Function to close a file - it will not be able to be used again unless the file is opened.
close
=
%s
:
39. End header line.
:
=
write
//=
40. assignment operator
<
*readline
=
+=
41. exponentiation
file.readline()
open()
|
a**b
42. adds an item to a list
%d
append()
+
%d
43. A logical operator which negates an expression so that it returns a value of True if the expression is false.
==
def
print
not
44. The extension for Python scripts
.py
/=
open()
**=
45. turns an object into a string
del
/
str()
//=
46. Turns a line into a comment instead of executable code.
del
#
n
argv
47. A statement that displays a value on the screen.
>>
.py
<=
print
48. Function to write something to a file
write
in
del
<
49. Function to open or read a file
insert()
open()
=
%
50. A logical operator which compares two operands and produces True if they are equal and False otherwise
Variables
n
==
in