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. Argument variable
#
|
argv
%=
2. rounds a number to the number of decimal points you choose
*read
continue
round()
def
3. A logical operator which returns a value of True if either of the conditions is true.
append()
raise
argv
or
4. single line comment
print
#
%s
/
5. A statement that assigns a value to a variable.
for
assignment
str()
<<
6. Function to empty the contents of a file - no recovery is possible
argument variable
truncate
len()
input()
7. Argument variable
*write(stuff)
if
close
argv
8. Prints a string to the screen which is a signed decimal.
%d
**=
a%b
9. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.
*read
/
print()
10. sets the file's current position
input()
/
*readline
file.seek()
11. The keyword beginning a header that will create a loop.
>=
-
~
for
12. floor division
a//b
=
argument variable
=
13. deletes an item from a list
~
argv
pass
del
14. A built-in function that converts its argument to a string.
/
<=
str
math.sqrt(a)
15. turns an object into a string
#
=
&
str()
16. 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.
/
*readline
=
argument variable
17. A keyword that does nothing but fill space to indicate code which will be written later.
/=
()
pass
read
18. assignment operator
=
continue
&
<=
19. Where the parameters go. A necessary punctuation after any function even if it's empty.
a%b
()
def
|
20. Symbol used to create comments
%r
insert()
//=
#
21. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
=
-
try
**=
22. divide AND assignment operator
str()
file.truncate()
str()
/=
23. Function to read the contents of a file
Variables
==
math.sqrt(a)
read
24. Symbol to multiply things
%s
%
*
str()
25. Greater than or equal symbol.
+=
raise
>=
return
26. inserts an item inside a list at a certain index
**=
insert()
~
assignment
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.
int
%s
not in
+=
28. This statement exits a function. The remaining lines of the function are not executed.
=
truncate
return
open()
29. 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
^
str
int()
append()
30. This keyword begins a header for a body that repeats until the condition is no longer true.
insert()
%
%s
while
31. square root
math.sqrt(a)
%=
>
~
32. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111
n
//=
%r
>>
33. A logical operator which requires two expressions to both be true.
>=
and
in
-=
34. Reads just one line of a text file.
//=
#
*readline
a**b
35. Command to print to the screen
print
#
raise
*
36. modulus AND assignment operator
in
argv
<
%=
37. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
|
//=
del
or
38. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
<=
&
else
a//b
39. Adds something to a variable
=
:
%r
for
40. absolute value
a%b
math.sqrt(a)
.py
abs(a)
41. The keyword beginning a header that will create a loop.
insert()
for
truncate
n
42. asks the user for a response and returns that response
str
input()
>=
int
43. assignment operator
close
if
=
append()
44. Symbol to divide by the number to the right of the symbol
/
insert()
else
while
45. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
str
^
int
-=
46. returns the length of a string (number of characters)
print()
:
len()
**=
47. Create a variable.
=
abs(a)
*
n
48. rounds a number to the number of decimal points you choose
read
round()
a//b
write
49. add AND assignment operator
abs(a)
a%b
+=
while
50. Function to close a file - it will not be able to be used again unless the file is opened.
<
<=
close
print()