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. assignment operator
**=
>>
==
=
2. Prevents a runtime error from stopping the program.
except
insert()
elif (Else if)
/
3. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
elif (Else if)
<<
a**b
int
4. Where the parameters go. A necessary punctuation after any function even if it's empty.
for
and
()
//=
5. A keyword that does nothing but fill space to indicate code which will be written later.
pass
file.seek()
%=
print()
6. This keyword in the body of a conditional - gives an alternative execution.
*write(stuff)
else
read
round()
7. turns an object into an integer
not in
<<
int()
floating point number
8. The keyword beginning a header that will create a loop.
while
+=
for
:
9. writes stuff to the file
|
file.write(stuff)
*read
readline
10. Less than or equal to symbol
input()
else
<=
&
11. The keyword beginning a header that will create a new function.
/=
==
%=
def
12. Function to close a file - it will not be able to be used again unless the file is opened.
>=
print()
class
close
13. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
=
~
+=
#
14. The keyword beginning a header that will create a new function.
~
print
>=
def
15. floor division AND assignment operator
a**b
*=
>
//=
16. 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
write
>>
float
pass
17. Function to read the contents of a file
<=
-
read
#
18. single line comment
#
//=
()
19. Modulus operator. It's the remainder after division
for
del
%d
%
20. Empties the file - watch out if you care about the file.
*read
*truncate
a**b
del
21. square root
>=
else
readline
math.sqrt(a)
22. Greater than symbol
<=
print
>
insert()
23. Adds something to a variable
print
&
=
>>
24. Command to print to the screen
print
>
read
not
25. Symbol to divide by the number to the right of the symbol
=
:
return
/
26. exponent AND assignment operator
math.sqrt(a)
not
**=
truncate
27. exponentiation
close
**=
a**b
Variables
28. adds an item to a list
print
append()
<
len()
29. Adds a new line character
/
<=
n
except
30. modulo
=
.py
a%b
<
31. Function to empty the contents of a file - no recovery is possible
a**b
del
print
truncate
32. sets the file's current position
print()
/=
file.seek()
print
33. unction to read one line of a file
==
readline
not
def
34. 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
write
=
>=
35. Command to print to the screen
print
==
#
:
36. Turns a line into a comment instead of executable code.
#
a//b
%s
=
37. modulus AND assignment operator
len()
argv
~
%=
38. 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.
>>
/=
argument variable
int()
39. 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.
floating point number
str()
not in
+=
40. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
>>
*read
format string
=
41. Function to open or read a file
except
-
open()
input()
42. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
and
*readline
>
argument variable
43. 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
<<
insert()
read
open()
44. reads just one line of a text file & keeps track of where in the file you're at
%r
%r
del
file.readline()
45. Symbol to multiply things
read
len()
*
=
46. inserts an item inside a list at a certain index
insert()
elif (Else if)
=
47. Prints a string to the screen which is converted using repr()
%r
and
or
|
48. returns the length of a string (number of characters)
%s
len()
append()
assignment
49. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
+=
|
write
len()
50. A logical operator which requires two expressions to both be true.
and
input()
=