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. Less than symbol
%
<
#
a**b
2. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
n
int
*readline
try
3. empties the file
a**b
file.truncate()
str
:
4. The extension for Python scripts
break
.py
input()
print
5. The keyword beginning a header that will create a loop.
for
:
str()
+=
6. Adds something to a variable
try
/=
del
=
7. Function to write something to a file
print
write
-=
n
8. ,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.
#
insert()
>=
9. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
in
return
n
10. The keyword beginning a header that will create a loop.
file.readline()
Variables
for
str()
11. Reads the contents of the file you can assign the result to a variable.
*read
print
if
close
12. A data type for representing numbers with fractional values.
#
<
floating point number
*write(stuff)
13. absolute value
abs(a)
n
int
a**b
14. Prints a string to the screen which is a signed decimal.
abs(a)
//=
%d
&
15. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
>>
break
argument variable
class
16. A keyword that does nothing but fill space to indicate code which will be written later.
pass
len()
>=
append()
17. Greater than or equal symbol.
floating point number
>=
elif (Else if)
:
18. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
/
int
open()
>
19. The keyword beginning a header that will create a new function.
def
()
readline
except
20. turns an object into a string
file.seek()
n
str()
:
21. floor division
%
a//b
n
%r
22. sets the file's current position
|
.py
=
file.seek()
23. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
class
~
print()
*=
24. Writes stuff to the file.
*write(stuff)
open()
*readline
del
25. inserts an item inside a list at a certain index
in
del
insert()
class
26. This keyword in the body of a conditional - gives an alternative execution.
int
else
del
int()
27. multiply AND assignment operator
#
*=
<=
//=
28. square root
else
a%b
math.sqrt(a)
print
29. modulo
()
^
for
a%b
30. 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
^
close
+=
class
31. Adds a new line character
float
n
<<
%s
32. divide AND assignment operator
abs(a)
/=
+
+=
33. exponent AND assignment operator
&
not
print
**=
34. Modulus operator. It's the remainder after division
*=
%
=
close
35. A statement that ends the current iteration of a loop but continues looping.
pass
continue
<=
Variables
36. floor division AND assignment operator
//=
~
<
raise
37. returns the length of a string (number of characters)
format string
print
len()
is not
38. This statement causes an exception.
raise
**=
file.truncate()
def
39. 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
<<
n
a//b
write
40. Command to print to the screen
Variables
&
-
print
41. Reads just one line of a text file.
n
>>
*readline
+=
42. deletes an item from a list
del
abs(a)
+
open()
43. turns an object into a string
-
()
//=
str()
44. Where the parameters go. A necessary punctuation after any function even if it's empty.
/
=
()
%r
45. asks the user for a response and returns that response
continue
file.seek()
input()
%s
46. Turns a line into a comment instead of executable code.
a%b
argument variable
=
#
47. turns an object into an integer
or
int()
>>
48. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
else
#
>=
49. End header line.
:
read
len()
try
50. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
>
int()
int()