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. square root
>
%d
math.sqrt(a)
read
2. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
=
=
%s
|
3. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
in
n
|
abs(a)
4. Modulus operator. It's the remainder after division
float
%
%s
while
5. reads just one line of a text file & keeps track of where in the file you're at
not
n
file.readline()
and
6. This statement causes an exception.
+=
=
^
raise
7. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
%r
%r
len()
8. This keyword begins the simplest form of a conditional statement.
<
argv
for
if
9. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
pass
write
and
~
10. Symbol to divide by the number to the right of the symbol
<<
>=
/
.py
11. Function to write something to a file
len()
floating point number
while
write
12. modulus AND assignment operator
%=
if
-
|
13. Reads just one line of a text file.
a//b
print
*readline
break
14. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
open()
*=
Variables
<
15. asks the user for a response and returns that response
=
print
-
input()
16. Empties the file - watch out if you care about the file.
a//b
*write(stuff)
()
*truncate
17. Reads the contents of the file you can assign the result to a variable.
print
str()
-=
*read
18. Adds something to a variable
#
=
else
math.sqrt(a)
19. Adds something to a variable
is
>>
=
argv
20. Function to write something to a file
%d
write
math.sqrt(a)
int
21. divide AND assignment operator
-
argv
/=
%d
22. single line comment
()
/
#
:
23. Function to empty the contents of a file - no recovery is possible
str()
truncate
.py
24. exponent AND assignment operator
file.truncate()
**=
break
else
25. sets the file's current position
%s
file.seek()
*read
a%b
26. 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.
open()
def
float
argument variable
27. Command to print to the screen
*
print
<<
except
28. Less than symbol
<
int()
>>
/=
29. square root
//=
a**b
or
math.sqrt(a)
30. prints its parameter to the console
/=
print()
*
truncate
31. multiply AND assignment operator
str()
*=
%
assignment
32. 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
>=
^
<=
&
33. Greater than or equal symbol.
>=
%r
|
insert()
34. exponentiation
.py
<<
a**b
*
35. Prints a string to the screen which is a signed decimal.
**=
math.sqrt(a)
%d
~
36. Symbol to subtract things from each other
-
n
for
math.sqrt(a)
37. assignment operator
if
()
*
=
38. 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
continue
<<
39. rounds a number to the number of decimal points you choose
round()
#
else
def
40. Argument variable
#
int()
read
argv
41. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
-
append()
str
and
42. subtract AND assignment operator
write
for
def
-=
43. Turns a line into a comment instead of executable code.
==
#
input()
file.truncate()
44. Argument variable
//=
argv
a%b
#
45. Prints a string to the screen which will be Unicode.
%s
raise
for
>=
46. A statement that displays a value on the screen.
readline
+=
print
*=
47. Writes stuff to the file.
=
*write(stuff)
except
//=
48. rounds a number to the number of decimal points you choose
close
round()
if
a**b
49. A statement that assigns a value to a variable.
.py
%s
break
assignment
50. A built-in function that converts its argument to a string.
file.truncate()
=
str
>=