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. Prints a string to the screen which will be Unicode.
%s
+=
:
#
2. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
append()
write
Variables
*=
3. The extension for Python scripts
append()
.py
input()
open()
4. Less than symbol
-
*write(stuff)
math.sqrt(a)
<
5. writes stuff to the file
for
file.write(stuff)
not
append()
6. 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
%d
|
7. Turns a line into a comment instead of executable code.
assignment
&
>
#
8. floor division
/=
a//b
==
file.write(stuff)
9. Greater than or equal symbol.
>=
append()
%r
*=
10. assignment operator
readline
print
%=
=
11. inserts an item inside a list at a certain index
abs(a)
*write(stuff)
insert()
~
12. Function to open or read a file
>>
len()
open()
/
13. This keyword in the body of a conditional - gives an alternative execution.
assignment
truncate
>
else
14. empties the file
file.truncate()
*
n
read
15. floor division AND assignment operator
//=
file.write(stuff)
file.seek()
del
16. Symbol to subtract things from each other
-
close
is
len()
17. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111
=
abs(a)
raise
>>
18. An operator to check whether two variables refer to the same object.
return
math.sqrt(a)
is
19. asks the user for a response and returns that response
input()
*
int
try
20. A built-in function that converts integers and strings to floating-point numbers.
is
Variables
float
==
21. Adds a new line character
n
else
>>
22. modulo
a%b
del
close
%s
23. exponentiation
print
or
a**b
~
24. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111
int()
>>
=
def
25. Where the parameters go. A necessary punctuation after any function even if it's empty.
else
*
()
#
26. 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.
abs(a)
*=
insert()
in
27. Function to empty the contents of a file - no recovery is possible
print
%d
truncate
append()
28. 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
<<
int
n
close
29. Adds something to a variable
and
=
%d
else
30. unction to read one line of a file
readline
not
read
%s
31. Modulus operator. It's the remainder after division
==
%
<<
in
32. A keyword that does nothing but fill space to indicate code which will be written later.
read
print()
//=
pass
33. deletes an item from a list
del
abs(a)
*truncate
file.seek()
34. Function to write something to a file
math.sqrt(a)
*readline
write
*write(stuff)
35. Create a variable.
write
input()
^
=
36. 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
:
+=
^
a//b
37. This keyword begins a header for a body that repeats until the condition is no longer true.
//=
len()
insert()
while
38. unction to read one line of a file
not in
str
=
readline
39. Prints a string to the screen which is a signed decimal.
-=
%d
file.truncate()
/=
40. This keyword in the body of a conditional allows chained conditionals.
>
continue
elif (Else if)
%
41. modulo
*
a%b
open()
%d
42. Function to close a file - it will not be able to be used again unless the file is opened.
is not
close
+
#
43. divide AND assignment operator
*read
/=
/
Variables
44. exponentiation
a**b
n
print()
print
45. Empties the file - watch out if you care about the file.
*truncate
int()
for
math.sqrt(a)
46. Adds a new line character
:
argv
pass
n
47. ,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.
readline
not
raise
48. Prevents a runtime error from stopping the program.
except
a//b
%d
&
49. Symbol to multiply things
>>
int()
format string
*
50. This statement causes an exception.
pass
%d
def
raise