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. Function to write something to a file
*truncate
write
()
is
2. 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.
insert()
#
not in
is not
3. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
<
raise
Variables
%
4. Where the parameters go. A necessary punctuation after any function even if it's empty.
=
int()
math.sqrt(a)
()
5. ,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
>
*=
6. reads just one line of a text file & keeps track of where in the file you're at
()
file.readline()
+=
&
7. Argument variable
argv
read
def
>>
8. The keyword beginning a header that will create a new function.
=
()
//=
def
9. Prints a string to the screen which is converted using repr()
%=
%r
or
int()
10. prints its parameter to the console
print()
print
#
pass
11. Reads just one line of a text file.
.py
read
*readline
:
12. Symbol to add things together
=
+
<
a//b
13. Symbol to add things together
%=
|
%d
+
14. returns the length of a string (number of characters)
len()
else
%r
/
15. Function to open or read a file
#
>=
%s
open()
16. adds an item to a list
+
append()
-
=
17. Symbol to subtract things from each other
-=
-
~
//=
18. Create a variable.
=
read
>
**=
19. turns an object into a string
or
assignment
str()
*read
20. A data type for representing numbers with fractional values.
input()
floating point number
=
for
21. Adds a new line character
==
n
elif (Else if)
*
22. A keyword that does nothing but fill space to indicate code which will be written later.
while
a//b
del
pass
23. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
.py
int
=
argument variable
24. 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
a**b
-
a//b
<<
25. Less than symbol
float
<
==
>=
26. Prevents a runtime error from stopping the program.
a//b
except
file.truncate()
>>
27. The keyword beginning a header that will create a loop.
=
%s
for
a%b
28. prints its parameter to the console
print()
close
a**b
argv
29. multiply AND assignment operator
elif (Else if)
/
*=
**=
30. Where the parameters go. A necessary punctuation after any function even if it's empty.
truncate
*write(stuff)
in
()
31. The extension for Python scripts
.py
*truncate
<<
<=
32. The extension for Python scripts
del
in
.py
=
33. assignment operator
abs(a)
=
math.sqrt(a)
is
34. divide AND assignment operator
/=
input()
%r
is not
35. Less than symbol
not in
and
<
>>
36. Symbol to multiply things
%s
*=
except
*
37. floor division AND assignment operator
//=
%r
|
else
38. This keyword in the body of a conditional - gives an alternative execution.
else
>>
%=
<
39. Prints a string to the screen which will be Unicode.
%s
print
%r
#
40. Function to empty the contents of a file - no recovery is possible
file.write(stuff)
file.truncate()
truncate
*read
41. The keyword beginning a header that will create a new function.
def
del
break
readline
42. A statement that assigns a value to a variable.
argv
assignment
-
-
43. assignment operator
/
=
|
if
44. Argument variable
argv
append()
>
==
45. Create a variable.
append()
=
is not
print
46. Reads the contents of the file you can assign the result to a variable.
%
|
*read
assignment
47. add AND assignment operator
Variables
+=
=
floating point number
48. Symbol to divide by the number to the right of the symbol
/
*read
round()
49. End header line.
in
and
<
:
50. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
print
class
file.readline()
%