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 string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
~
format string
#
/
2. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
Variables
%=
read
3. Greater than or equal symbol.
>=
len()
-
*write(stuff)
4. Function to close a file - it will not be able to be used again unless the file is opened.
argv
|
close
int()
5. Symbol to subtract things from each other
n
a%b
try
-
6. multiply AND assignment operator
if
*=
*
<<
7. modulo
a//b
math.sqrt(a)
for
a%b
8. Less than or equal to symbol
<=
return
.py
-
9. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
is
str()
%d
class
10. Function to write something to a file
write
:
insert()
%r
11. absolute value
abs(a)
a//b
:
%
12. Function to read the contents of a file
int()
print
read
not in
13. inserts an item inside a list at a certain index
else
n
input()
insert()
14. Command to print to the screen
print
==
str()
input()
15. Prints a string to the screen which will be Unicode.
in
%d
for
%s
16. Greater than symbol
>
print
file.readline()
&
17. A built-in function that converts its argument to a string.
truncate
str
else
>
18. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
file.readline()
=
in
19. Function to write something to a file
append()
write
in
-
20. A logical operator which requires two expressions to both be true.
except
argv
and
%d
21. 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.
truncate
continue
len()
in
22. An operator that removes a value from a list.
argv
del
=
truncate
23. absolute value
Variables
/=
|
abs(a)
24. square root
a%b
pass
print()
math.sqrt(a)
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
^
>=
format string
readline
26. add AND assignment operator
=
+=
==
truncate
27. Function to close a file - it will not be able to be used again unless the file is opened.
*read
>=
math.sqrt(a)
close
28. A statement that assigns a value to a variable.
assignment
elif (Else if)
<
<<
29. divide AND assignment operator
/=
a//b
-=
+
30. unction to read one line of a file
print
<
readline
<
31. Create a variable.
assignment
readline
abs(a)
=
32. Argument variable
argv
%
print
//=
33. This keyword begins a header for a body that repeats until the condition is no longer true.
append()
while
>=
*
34. Prints a string to the screen which is a signed decimal.
continue
%d
append()
*read
35. A logical operator which negates an expression so that it returns a value of True if the expression is false.
append()
not
|
%=
36. deletes an item from a list
&
del
print
37. 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.
%d
argument variable
=
>
38. Symbol to multiply things
^
Variables
a//b
*
39. reads just one line of a text file & keeps track of where in the file you're at
abs(a)
%
file.readline()
str()
40. subtract AND assignment operator
a**b
print
write
-=
41. Symbol to divide by the number to the right of the symbol
/
/=
str
*=
42. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000
else
/=
<<
=
43. divide AND assignment operator
/=
^
open()
*
44. exponentiation
&
<
and
a**b
45. Prevents a runtime error from stopping the program.
except
==
file.seek()
+
46. Symbol to add things together
+
*
close
if
47. Empties the file - watch out if you care about the file.
close
>=
*truncate
&
48. A statement that breaks out of a loop.
len()
|
break
=
49. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
n
|
readline
~
50. The keyword beginning a header that will create a loop.
/
==
argv
for