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. Reads the contents of the file you can assign the result to a variable.
/
if
*read
%s
2. This keyword begins the simplest form of a conditional statement.
if
<
*
%=
3. Prints a string to the screen which is converted using repr()
%r
not
str()
//=
4. Function to write something to a file
>=
continue
assignment
write
5. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
#
int
()
//=
6. This keyword in the body of a conditional allows chained conditionals.
elif (Else if)
+=
is not
==
7. The extension for Python scripts
()
raise
.py
=
8. A statement that assigns a value to a variable.
.py
assignment
and
#
9. The keyword beginning a header that will create a loop.
readline
~
<<
for
10. Less than symbol
math.sqrt(a)
while
file.seek()
<
11. A built-in function that converts integers and strings to floating-point numbers.
<=
str()
+
float
12. prints its parameter to the console
not
<<
print()
a//b
13. A logical operator which compares two operands and produces True if they are equal and False otherwise
>>
is not
==
argv
14. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
#
Variables
print
#
15. 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
<<
==
<
str()
16. writes stuff to the file
%s
file.write(stuff)
read
^
17. modulo
<<
a%b
Variables
round()
18. A logical operator which compares two operands and produces True if they are equal and False otherwise
>=
Variables
==
%d
19. ,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.
>>
len()
>
20. rounds a number to the number of decimal points you choose
write
/=
is not
round()
21. This statement causes an exception.
raise
<
*read
&
22. reads just one line of a text file & keeps track of where in the file you're at
append()
file.readline()
argv
=
23. Function to empty the contents of a file - no recovery is possible
open()
else
truncate
int
24. Prints a string to the screen which is converted using repr()
%r
%
:
del
25. divide AND assignment operator
open()
-=
=
/=
26. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
and
Variables
len()
+=
27. This keyword begins the simplest form of a conditional statement.
*read
def
=
if
28. multiply AND assignment operator
del
*=
=
insert()
29. returns the length of a string (number of characters)
Variables
round()
//=
len()
30. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
*=
-=
|
math.sqrt(a)
31. floor division AND assignment operator
:
input()
//=
=
32. Create a variable.
Variables
not in
=
*
33. square root
in
math.sqrt(a)
is
a//b
34. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
else
print()
in
n
35. turns an object into an integer
int()
round()
append()
|
36. A data type for representing numbers with fractional values.
floating point number
#
n
insert()
37. modulo
*
*readline
a%b
in
38. Less than or equal to symbol
<=
and
append()
append()
39. Symbol used to create comments
file.truncate()
#
*
|
40. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
int
class
-
n
41. Prints a string to the screen which will be Unicode.
write
>>
math.sqrt(a)
%s
42. Prints a string to the screen which is a signed decimal.
round()
#
==
%d
43. Symbol to divide by the number to the right of the symbol
print()
/
del
*
44. 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.
del
truncate
not in
del
45. Symbol to add things together
a//b
=
+
()
46. Function to read the contents of a file
input()
read
%r
del
47. exponentiation
Variables
a**b
<
write
48. Command to print to the screen
str
:
()
print
49. Adds a new line character
==
n
%=
file.truncate()
50. Greater than or equal symbol.
//=
insert()
>=
and