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. ,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.
else
%s
=
2. Greater than symbol
truncate
>
=
^
3. deletes an item from a list
&
readline
del
#
4. Prints a string to the screen which is a signed decimal.
else
*=
%d
truncate
5. Create a variable.
a//b
open()
int()
=
6. writes stuff to the file
<=
in
file.write(stuff)
def
7. Symbol to multiply things
%d
break
*
8. reads just one line of a text file & keeps track of where in the file you're at
>=
:
int()
file.readline()
9. returns the length of a string (number of characters)
a//b
open()
len()
//=
10. inserts an item inside a list at a certain index
write
*=
insert()
a//b
11. The keyword beginning a header that will create a loop.
>
for
int()
try
12. Symbol to subtract things from each other
a**b
str
%s
-
13. Function to empty the contents of a file - no recovery is possible
close
except
else
truncate
14. unction to read one line of a file
else
readline
print()
is
15. Where the parameters go. A necessary punctuation after any function even if it's empty.
%
=
()
file.readline()
16. A logical operator which negates an expression so that it returns a value of True if the expression is false.
not
not in
insert()
if
17. 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).
-=
is not
a%b
>>
18. Adds something to a variable
print
format string
round()
=
19. Function to empty the contents of a file - no recovery is possible
/=
truncate
:
^
20. The keyword beginning a header that will create a new function.
%s
close
def
write
21. 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
>
+
<<
#
22. exponent AND assignment operator
return
()
**=
floating point number
23. multiply AND assignment operator
try
&
*=
not in
24. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
%d
#
|
float
25. A statement that breaks out of a loop.
break
a**b
#
*
26. An operator to check whether two variables refer to the same object.
*truncate
is
except
break
27. exponentiation
a**b
%=
=
=
28. The keyword beginning a header that will create a loop.
for
/
argument variable
>>
29. A statement that ends the current iteration of a loop but continues looping.
continue
**=
|
a%b
30. Function to write something to a file
not
else
write
==
31. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
print()
and
>>
*read
32. A logical operator which returns a value of True if either of the conditions is true.
or
is
^
33. single line comment
>=
append()
#
/
34. Prevents a runtime error from stopping the program.
int
&
except
argv
35. returns the length of a string (number of characters)
len()
break
=
*
36. 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
:
%
>>
append()
37. Modulus operator. It's the remainder after division
~
not in
+
%
38. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
&
.py
**=
else
39. sets the file's current position
file.seek()
else
pass
:
40. exponentiation
<
a**b
pass
:
41. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
<
%
&
abs(a)
42. Prints a string to the screen which will be Unicode.
%s
for
abs(a)
=
43. Empties the file - watch out if you care about the file.
*read
#
*truncate
file.readline()
44. add AND assignment operator
#
+=
-
len()
45. divide AND assignment operator
==
/=
int
argument variable
46. End header line.
:
is not
()
insert()
47. Prints a string to the screen which is converted using repr()
a%b
write
%r
-=
48. 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.
file.seek()
<
for
argument variable
49. asks the user for a response and returns that response
-
input()
=
%=
50. 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.
floating point number
insert()
in
else