SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
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. asks the user for a response and returns that response
del
in
*write(stuff)
input()
2. 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
floating point number
<<
*
float
3. Adds something to a variable
-=
=
==
>>
4. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
/=
#
len()
&
5. modulus AND assignment operator
def
%=
input()
open()
6. square root
%s
int()
math.sqrt(a)
==
7. A statement that displays a value on the screen.
print
argument variable
int
<
8. Symbol to add things together
*
print
+
format string
9. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
**=
close
%
format string
10. This statement causes an exception.
elif (Else if)
open()
raise
=
11. Create a variable.
=
except
%r
else
12. returns the length of a string (number of characters)
len()
/=
>=
else
13. Greater than symbol
>
int()
**=
for
14. Less than symbol
not in
*
<
#
15. multiply AND assignment operator
&
*=
%d
%r
16. exponentiation
~
round()
a**b
+=
17. An operator that removes a value from a list.
del
if
>
insert()
18. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
int()
while
<<
|
19. This statement exits a function. The remaining lines of the function are not executed.
str()
return
<<
&
20. Prints a string to the screen which is converted using repr()
print
+
%r
file.truncate()
21. Argument variable
argv
input()
def
*
22. 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
>=
*readline
|
23. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
+=
file.readline()
-
~
24. modulo
%=
a%b
input()
~
25. A statement that ends the current iteration of a loop but continues looping.
def
a**b
continue
%r
26. The keyword beginning a header that will create a loop.
*
for
^
file.readline()
27. Less than or equal to symbol
==
len()
<=
**=
28. turns an object into a string
raise
str()
open()
assignment
29. End header line.
:
*
print()
%r
30. floor division
**=
a//b
math.sqrt(a)
class
31. turns an object into a string
>=
~
#
str()
32. floor division
%r
a**b
raise
a//b
33. Modulus operator. It's the remainder after division
/
<<
%
*write(stuff)
34. returns the length of a string (number of characters)
a%b
len()
Variables
-=
35. Function to open or read a file
def
open()
print
readline
36. assignment operator
open()
in
def
=
37. Command to print to the screen
print
del
*
open()
38. Reads the contents of the file you can assign the result to a variable.
*read
append()
except
-
39. prints its parameter to the console
print()
del
write
|
40. Prints a string to the screen which is a signed decimal.
input()
str
%d
%s
41. Adds a new line character
str
n
write
write
42. This keyword begins the simplest form of a conditional statement.
/
if
str()
%=
43. Prints a string to the screen which is converted using repr()
class
or
argv
%r
44. Empties the file - watch out if you care about the file.
print
read
not
*truncate
45. rounds a number to the number of decimal points you choose
#
%=
round()
&
46. add AND assignment operator
len()
//=
*=
+=
47. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
#
for
/=
class
48. single line comment
>>
/=
#
=
49. prints its parameter to the console
print()
#
:
continue
50. floor division AND assignment operator
abs(a)
a**b
/
//=
GET PROVEN ADVICE FROM 100+ BEST
BOOKS IN 1 BOOK
The World's First & Only Encyclopedia of
Self Help, Self Improvement & Career Advice
250+ Easy-to-Follow Guides
5000+ Proven Tips
13 Types of Essential Skills
502 Pages | Just $3.99 | PDF / EPub, Kindle Ready
Top Scores
Anon hero
- 100%
Link to This Test
Related Subjects
Soft Skills
Business Skills