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. unction to read one line of a file
#
readline
/=
=
2. subtract AND assignment operator
input()
-=
=
*
3. Where the parameters go. A necessary punctuation after any function even if it's empty.
append()
()
+=
write
4. modulus AND assignment operator
%=
def
round()
<=
5. 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
is
>>
==
file.readline()
6. Prints a string to the screen which will be Unicode.
pass
-=
%s
abs(a)
7. This statement causes an exception.
//=
==
%r
raise
8. Greater than or equal symbol.
>>
>=
&
while
9. rounds a number to the number of decimal points you choose
round()
#
write
close
10. This keyword begins the simplest form of a conditional statement.
if
.py
~
elif (Else if)
11. This keyword in the body of a conditional - gives an alternative execution.
a**b
>
math.sqrt(a)
else
12. The extension for Python scripts
.py
and
input()
is
13. square root
math.sqrt(a)
a**b
#
append()
14. divide AND assignment operator
str()
/=
math.sqrt(a)
<<
15. floor division
a//b
+=
and
=
16. Function to read the contents of a file
>=
<<
elif (Else if)
read
17. Adds something to a variable
read
|
&
=
18. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
str
format string
#
math.sqrt(a)
19. Prints a string to the screen which is a signed decimal.
a//b
%
%d
n
20. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
~
>>
len()
21. inserts an item inside a list at a certain index
class
%d
write
insert()
22. Where the parameters go. A necessary punctuation after any function even if it's empty.
int
>>
()
and
23. Reads the contents of the file you can assign the result to a variable.
<<
<
*read
def
24. Symbol to multiply things
print()
not
argument variable
*
25. 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
in
26. Function to open or read a file
open()
read
<
if
27. A logical operator which compares two operands and produces True if they are equal and False otherwise
%
argv
==
print
28. modulo
raise
or
a%b
class
29. Function to read the contents of a file
>=
-=
floating point number
read
30. square root
%s
math.sqrt(a)
<
|
31. Less than or equal to symbol
<=
else
%s
len()
32. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).
is not
file.write(stuff)
round()
%
33. writes stuff to the file
file.write(stuff)
n
*
:
34. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
round()
.py
**=
35. End header line.
:
round()
%d
a//b
36. 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
>>
continue
input()
<<
37. modulus AND assignment operator
a**b
print
%=
input()
38. An operator that removes a value from a list.
del
^
print
39. A statement that breaks out of a loop.
-
*read
break
>=
40. exponent AND assignment operator
%
**=
read
return
41. adds an item to a list
n
file.write(stuff)
append()
-=
42. This keyword begins the simplest form of a conditional statement.
abs(a)
if
argv
round()
43. Prints a string to the screen which is converted using repr()
=
%r
>=
append()
44. Prints a string to the screen which is converted using repr()
%r
or
format string
//=
45. Symbol to add things together
&
+
#
+=
46. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
truncate
*write(stuff)
+
47. The keyword beginning a header that will create a new function.
close
:
print
def
48. Function to open or read a file
=
print()
open()
#
49. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
a//b
//=
**=
int
50. asks the user for a response and returns that response
pass
input()
print
%=