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. 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.
break
argument variable
print
<
2. rounds a number to the number of decimal points you choose
round()
print
=
read
3. empties the file
file.truncate()
input()
int
open()
4. unction to read one line of a file
*write(stuff)
math.sqrt(a)
readline
a**b
5. turns an object into a string
%d
-=
str()
for
6. Modulus operator. It's the remainder after division
/=
:
%
math.sqrt(a)
7. Argument variable
and
argv
//=
>
8. Greater than symbol
/
.py
>
for
9. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
//=
else
class
**=
10. add AND assignment operator
+=
input()
%
:
11. Turns a line into a comment instead of executable code.
in
del
#
>
12. The keyword beginning a header that will create a loop.
for
def
round()
raise
13. A statement that assigns a value to a variable.
and
readline
assignment
del
14. This statement exits a function. The remaining lines of the function are not executed.
open()
return
%s
readline
15. Symbol to divide by the number to the right of the symbol
len()
/
-=
=
16. deletes an item from a list
<=
del
print
print
17. absolute value
=
abs(a)
&
<=
18. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
-
close
argv
19. Command to print to the screen
print
>>
=
assignment
20. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
abs(a)
a%b
|
if
21. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
/=
Variables
%s
22. Symbol to multiply things
insert()
>>
*
format string
23. This keyword in the body of a conditional allows chained conditionals.
%=
not
*read
elif (Else if)
24. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
-=
del
and
a**b
25. prints its parameter to the console
%s
print()
.py
=
26. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
is
else
del
27. deletes an item from a list
del
readline
-=
Variables
28. 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.
>>
in
<<
str()
29. End header line.
()
:
read
30. This keyword in the body of a conditional - gives an alternative execution.
del
else
<<
>
31. This keyword begins the simplest form of a conditional statement.
if
=
Variables
-
32. This keyword begins a header for a body that repeats until the condition is no longer true.
+=
while
.py
/
33. Prevents a runtime error from stopping the program.
open()
except
else
>=
34. Command to print to the screen
print
str()
is not
input()
35. square root
math.sqrt(a)
//=
abs(a)
round()
36. Prints a string to the screen which will be Unicode.
len()
%s
and
float
37. Less than or equal to symbol
<=
n
file.seek()
<<
38. A statement that ends the current iteration of a loop but continues looping.
continue
*
print
.py
39. Symbol used to create comments
#
a**b
/=
input()
40. Function to write something to a file
write
:
input()
file.truncate()
41. inserts an item inside a list at a certain index
file.write(stuff)
insert()
append()
<<
42. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
del
Variables
<=
argv
43. asks the user for a response and returns that response
input()
%d
close
~
44. Adds a new line character
a//b
n
file.readline()
.py
45. Symbol to divide by the number to the right of the symbol
==
*=
a//b
/
46. Prints a string to the screen which is a signed decimal.
%d
#
a%b
%s
47. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
str()
close
for
48. Prints a string to the screen which will be Unicode.
floating point number
**=
%s
open()
49. 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
+
argv
&
50. divide AND assignment operator
==
/=
=
round()