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. 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
=
%d
<<
2. Reads just one line of a text file.
%=
*
*readline
*
3. This keyword begins the simplest form of a conditional statement.
#
//=
if
**=
4. turns an object into an integer
-=
**=
int()
%d
5. A built-in function that converts its argument to a string.
del
else
#
str
6. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
print()
int()
*=
~
7. The keyword beginning a header that will create a new function.
Variables
def
.py
>
8. turns an object into an integer
int()
return
except
open()
9. subtract AND assignment operator
//=
==
**=
-=
10. The keyword beginning a header that will create a new function.
def
append()
*=
/=
11. rounds a number to the number of decimal points you choose
in
round()
return
def
12. single line comment
-=
argv
#
except
13. Adds something to a variable
>>
*readline
=
if
14. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).
input()
*
for
is not
15. A built-in function that converts integers and strings to floating-point numbers.
+
float
-
file.write(stuff)
16. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
len()
len()
%d
17. exponentiation
#
a**b
<=
**=
18. divide AND assignment operator
#
/=
*
*write(stuff)
19. adds an item to a list
try
Variables
*=
append()
20. unction to read one line of a file
readline
%r
argv
*truncate
21. Function to open or read a file
else
readline
open()
+
22. 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
<
&
23. Function to read the contents of a file
read
print
*=
round()
24. Prevents a runtime error from stopping the program.
except
^
return
write
25. This keyword in the body of a conditional - gives an alternative execution.
open()
str()
/=
else
26. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
>
+
*read
and
27. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
%
try
a%b
except
28. 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
break
^
29. A statement that assigns a value to a variable.
print
readline
#
assignment
30. inserts an item inside a list at a certain index
del
insert()
==
str()
31. Modulus operator. It's the remainder after division
#
argv
%
write
32. Adds something to a variable
=
or
%=
round()
33. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
append()
#
read
Variables
34. A statement that breaks out of a loop.
break
and
int()
read
35. This statement causes an exception.
^
#
raise
read
36. returns the length of a string (number of characters)
a%b
*=
floating point number
len()
37. Prints a string to the screen which will be Unicode.
/
#
%s
if
38. Prints a string to the screen which is converted using repr()
and
*readline
%r
~
39. inserts an item inside a list at a certain index
print
.py
del
insert()
40. asks the user for a response and returns that response
input()
()
file.readline()
>
41. turns an object into a string
%=
>>
>
str()
42. Adds a new line character
float
%=
n
%r
43. Where the parameters go. A necessary punctuation after any function even if it's empty.
+=
()
-=
#
44. Function to write something to a file
assignment
~
%=
write
45. square root
class
close
math.sqrt(a)
a**b
46. adds an item to a list
file.readline()
for
append()
try
47. sets the file's current position
<
file.seek()
file.truncate()
<<
48. modulus AND assignment operator
==
>>
or
%=
49. Create a variable.
=
file.seek()
int()
str()
50. Symbol to multiply things
>=
*
abs(a)
%d