SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
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. The extension for Python scripts
.py
a**b
round()
read
2. Less than symbol
/
else
#
<
3. turns an object into an integer
<<
/
int()
readline
4. The keyword beginning a header that will create a loop.
a%b
*readline
%r
for
5. Function to empty the contents of a file - no recovery is possible
/=
=
truncate
>>
6. Symbol to divide by the number to the right of the symbol
/
=
*read
len()
7. Function to close a file - it will not be able to be used again unless the file is opened.
read
if
%=
close
8. unction to read one line of a file
/=
while
readline
int()
9. exponent AND assignment operator
<
#
**=
=
10. adds an item to a list
append()
a**b
a//b
<<
11. Adds a new line character
n
not in
len()
>=
12. Prints a string to the screen which will be Unicode.
:
%s
str()
#
13. A logical operator which returns a value of True if either of the conditions is true.
or
file.write(stuff)
math.sqrt(a)
()
14. square root
math.sqrt(a)
break
*
append()
15. sets the file's current position
file.seek()
format string
=
#
16. Symbol to multiply things
is not
a%b
*
floating point number
17. asks the user for a response and returns that response
**=
*=
input()
*write(stuff)
18. Create a variable.
=
-
+=
insert()
19. prints its parameter to the console
continue
print()
n
a//b
20. This keyword in the body of a conditional - gives an alternative execution.
insert()
print
#
else
21. Function to empty the contents of a file - no recovery is possible
a**b
truncate
+=
except
22. Argument variable
print()
input()
-
argv
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.
-=
not in
//=
for
24. divide AND assignment operator
/=
int()
==
%
25. A logical operator which negates an expression so that it returns a value of True if the expression is false.
%
==
not
*truncate
26. 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
%=
a%b
.py
<<
27. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
%
print
class
28. absolute value
abs(a)
~
%r
str
29. 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.
**=
and
argument variable
round()
30. add AND assignment operator
if
+=
a//b
except
31. exponent AND assignment operator
**=
#
argv
break
32. returns the length of a string (number of characters)
file.truncate()
/=
+=
len()
33. Less than or equal to symbol
<
len()
<=
=
34. Symbol to subtract things from each other
append()
*write(stuff)
-
read
35. subtract AND assignment operator
-=
print
float
%d
36. turns an object into a string
str()
del
not in
>=
37. 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
and
<<
in
-=
38. This keyword begins the simplest form of a conditional statement.
insert()
**=
if
%d
39. deletes an item from a list
del
print
insert()
#
40. Modulus operator. It's the remainder after division
<<
()
a//b
%
41. divide AND assignment operator
class
while
truncate
/=
42. Prints a string to the screen which is a signed decimal.
assignment
%d
abs(a)
|
43. Function to open or read a file
<=
=
pass
open()
44. square root
math.sqrt(a)
len()
round()
%=
45. Prints a string to the screen which will be Unicode.
while
str()
<<
%s
46. Function to write something to a file
~
close
write
readline
47. 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
/
class
else
>>
48. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
>=
*write(stuff)
round()
~
49. multiply AND assignment operator
=
*=
close
Variables
50. 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
|
^
def
in