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. exponentiation
>=
float
%d
a**b
2. The keyword beginning a header that will create a new function.
#
<
int
def
3. 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
<<
len()
#
print()
4. A logical operator which requires two expressions to both be true.
**=
+
for
and
5. This keyword begins the simplest form of a conditional statement.
if
argv
=
.py
6. Prints a string to the screen which is a signed decimal.
%r
%d
<=
break
7. divide AND assignment operator
/=
write
%
for
8. prints its parameter to the console
~
=
print()
/=
9. Create a variable.
truncate
format string
=
%r
10. add AND assignment operator
|
+=
in
readline
11. This keyword begins the simplest form of a conditional statement.
round()
if
*write(stuff)
file.truncate()
12. Symbol to divide by the number to the right of the symbol
float
math.sqrt(a)
/
round()
13. subtract AND assignment operator
%r
write
-=
file.truncate()
14. 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
<<
break
*
15. Function to read the contents of a file
in
%=
read
floating point number
16. 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.
input()
in
assignment
**=
17. Where the parameters go. A necessary punctuation after any function even if it's empty.
print
/=
()
a%b
18. Adds a new line character
float
%=
a**b
n
19. Symbol to subtract things from each other
<
-
%s
%
20. Function to open or read a file
/
open()
read
+=
21. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
except
|
file.write(stuff)
%
22. Symbol to multiply things
*
+=
file.readline()
#
23. A keyword that does nothing but fill space to indicate code which will be written later.
pass
.py
append()
%
24. End header line.
#
<<
float
:
25. Prints a string to the screen which is a signed decimal.
=
else
%d
a//b
26. returns the length of a string (number of characters)
/
*=
append()
len()
27. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.
floating point number
%r
not in
len()
28. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
()
+
=
~
29. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
try
Variables
class
%d
30. The extension for Python scripts
.py
>=
print()
if
31. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
a//b
//=
Variables
>
32. End header line.
:
%s
close
len()
33. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
class
:
len()
a**b
34. Symbol to add things together
%s
class
+
argv
35. square root
&
%d
math.sqrt(a)
def
36. Prints a string to the screen which is converted using repr()
read
%r
Variables
continue
37. Greater than or equal symbol.
raise
>=
%s
*=
38. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
-
=
|
pass
39. adds an item to a list
%d
append()
a//b
and
40. Writes stuff to the file.
*write(stuff)
and
argv
>>
41. Prevents a runtime error from stopping the program.
or
assignment
except
/=
42. The keyword beginning a header that will create a new function.
def
print
%d
|
43. multiply AND assignment operator
argv
a//b
*=
/=
44. assignment operator
read
#
round()
=
45. modulo
a%b
<
+
>
46. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
argv
#
*readline
47. A logical operator which returns a value of True if either of the conditions is true.
or
math.sqrt(a)
-
a%b
48. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
#
try
=
/=
49. Adds something to a variable
+=
<=
*=
=
50. Turns a line into a comment instead of executable code.
-=
#
>
==