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. asks the user for a response and returns that response
*=
print
<<
input()
2. modulo
%s
a%b
abs(a)
while
3. This statement causes an exception.
*read
print
round()
raise
4. sets the file's current position
def
==
/
file.seek()
5. absolute value
*=
open()
abs(a)
/=
6. add AND assignment operator
str
print
+=
<
7. Symbol to add things together
=
*=
a%b
+
8. Greater than or equal symbol.
>=
>
except
|
9. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
/
print()
close
10. turns an object into a string
if
str()
input()
.py
11. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
len()
continue
**=
int
12. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
insert()
<
|
close
13. floor division AND assignment operator
>
read
%=
//=
14. The extension for Python scripts
format string
is not
.py
15. A statement that displays a value on the screen.
is not
print
<<
argv
16. A logical operator which compares two operands and produces True if they are equal and False otherwise
~
/=
==
*write(stuff)
17. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
if
>
+
~
18. Where the parameters go. A necessary punctuation after any function even if it's empty.
()
abs(a)
round()
%s
19. Writes stuff to the file.
str
%s
*write(stuff)
del
20. exponentiation
a**b
#
round()
~
21. A built-in function that converts integers and strings to floating-point numbers.
float
-=
elif (Else if)
//=
22. Create a variable.
=
round()
<=
input()
23. Prints a string to the screen which is a signed decimal.
#
break
%d
a**b
24. Modulus operator. It's the remainder after division
#
abs(a)
%
class
25. turns an object into an integer
or
a%b
int()
%
26. Greater than symbol
or
write
>
.py
27. absolute value
**=
=
~
abs(a)
28. End header line.
raise
for
a%b
:
29. This keyword begins the simplest form of a conditional statement.
if
/
*read
30. reads just one line of a text file & keeps track of where in the file you're at
file.readline()
else
int()
str
31. Symbol to divide by the number to the right of the symbol
a//b
>>
and
/
32. The keyword beginning a header that will create a loop.
/=
+=
math.sqrt(a)
for
33. 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.
<
argument variable
%r
print
34. A keyword that does nothing but fill space to indicate code which will be written later.
print
pass
%=
35. Symbol to multiply things
/
*
del
a//b
36. adds an item to a list
insert()
>>
<
append()
37. rounds a number to the number of decimal points you choose
=
round()
*write(stuff)
except
38. The keyword beginning a header that will create a new function.
not
truncate
def
math.sqrt(a)
39. Adds something to a variable
print()
=
def
file.readline()
40. A statement that ends the current iteration of a loop but continues looping.
continue
len()
<<
:
41. Symbol to add things together
+
*=
input()
elif (Else if)
42. Function to write something to a file
round()
write
*=
n
43. floor division AND assignment operator
^
//=
continue
len()
44. Symbol to divide by the number to the right of the symbol
%s
str()
and
/
45. Symbol used to create comments
#
and
str()
^
46. modulus AND assignment operator
%=
*truncate
append()
//=
47. 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
=
readline
^
else
48. subtract AND assignment operator
.py
/=
-=
%r
49. An operator to check whether two variables refer to the same object.
>=
is
if
and
50. A statement that breaks out of a loop.
*write(stuff)
break
pass
argv