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. unction to read one line of a file
n
print
readline
float
2. exponentiation
>=
append()
a**b
3. Turns a line into a comment instead of executable code.
>>
&
truncate
#
4. 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
<<
append()
del
int()
5. Greater than symbol
>
==
math.sqrt(a)
>>
6. Function to write something to a file
a//b
a//b
write
def
7. Symbol to multiply things
print
<=
*
/=
8. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
int
argv
%s
=
9. Prints a string to the screen which is converted using repr()
%r
%s
not in
read
10. turns an object into a string
floating point number
else
or
str()
11. End header line.
:
truncate
while
assignment
12. Command to print to the screen
floating point number
print
file.readline()
-
13. absolute value
and
while
abs(a)
^
14. reads just one line of a text file & keeps track of where in the file you're at
a%b
#
file.readline()
break
15. Empties the file - watch out if you care about the file.
<<
:
*truncate
^
16. floor division AND assignment operator
file.write(stuff)
//=
file.seek()
=
17. single line comment
#
.py
close
a//b
18. 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
print
//=
19. absolute value
assignment
%s
abs(a)
continue
20. asks the user for a response and returns that response
Variables
%s
=
input()
21. Command to print to the screen
a%b
print
argv
|
22. This keyword in the body of a conditional - gives an alternative execution.
*
*=
class
else
23. 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.
for
not in
insert()
if
24. A data type for representing numbers with fractional values.
:
floating point number
else
in
25. This statement exits a function. The remaining lines of the function are not executed.
>>
truncate
+
return
26. modulo
file.write(stuff)
<<
=
a%b
27. prints its parameter to the console
<=
print()
*read
for
28. turns an object into a string
&
pass
str()
^
29. turns an object into an integer
int()
break
else
is
30. The extension for Python scripts
n
*truncate
%r
.py
31. A logical operator which compares two operands and produces True if they are equal and False otherwise
int()
==
close
//=
32. 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
<<
file.truncate()
print
*
33. modulo
in
a%b
*=
def
34. floor division
float
a//b
&
=
35. Function to read the contents of a file
read
str()
-=
open()
36. 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.
input()
argument variable
input()
def
37. prints its parameter to the console
=
float
print()
del
38. 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
=
round()
>>
Variables
39. Symbol used to create comments
int
#
continue
argv
40. exponent AND assignment operator
print()
in
*readline
**=
41. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
float
not in
+=
42. subtract AND assignment operator
round()
-=
insert()
~
43. square root
print()
if
math.sqrt(a)
floating point number
44. add AND assignment operator
+=
#
**=
|
45. Greater than or equal symbol.
>=
int()
is
return
46. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
<=
#
class
open()
47. Writes stuff to the file.
del
=
=
*write(stuff)
48. Function to empty the contents of a file - no recovery is possible
truncate
*
abs(a)
*=
49. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
>=
=
-
try
50. empties the file
>>
%=
file.truncate()
argv