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. floor division
~
a//b
<
*write(stuff)
2. A statement that assigns a value to a variable.
%r
assignment
>=
if
3. floor division
if
a//b
-
readline
4. This keyword begins the simplest form of a conditional statement.
if
file.readline()
a**b
argv
5. Prints a string to the screen which will be Unicode.
-=
%s
read
//=
6. assignment operator
argv
in
//=
=
7. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
a//b
class
*=
close
8. returns the length of a string (number of characters)
len()
>=
pass
=
9. Function to write something to a file
*=
a//b
write
#
10. Greater than symbol
file.readline()
abs(a)
>
//=
11. This keyword in the body of a conditional allows chained conditionals.
=
elif (Else if)
-=
math.sqrt(a)
12. Command to print to the screen
assignment
str()
==
print
13. An operator that removes a value from a list.
/=
*=
del
format string
14. inserts an item inside a list at a certain index
append()
raise
write
insert()
15. This keyword begins a header for a body that repeats until the condition is no longer true.
while
argument variable
%r
file.truncate()
16. Function to close a file - it will not be able to be used again unless the file is opened.
truncate
del
close
a**b
17. Greater than or equal symbol.
>=
|
=
%s
18. add AND assignment operator
<
format string
#
+=
19. divide AND assignment operator
&
assignment
=
/=
20. End header line.
:
Variables
==
break
21. unction to read one line of a file
insert()
print()
readline
del
22. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
format string
del
Variables
round()
23. A keyword that does nothing but fill space to indicate code which will be written later.
.py
=
+
pass
24. Adds a new line character
.py
n
file.truncate()
^
25. Where the parameters go. A necessary punctuation after any function even if it's empty.
math.sqrt(a)
()
+
a//b
26. 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
%s
^
if
//=
27. 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.
truncate
len()
/=
argument variable
28. Argument variable
del
argv
>
input()
29. A statement that displays a value on the screen.
str()
input()
format string
print
30. Prints a string to the screen which will be Unicode.
str()
not in
%s
len()
31. adds an item to a list
append()
%r
or
~
32. A logical operator which compares two operands and produces True if they are equal and False otherwise
==
:
close
#
33. Symbol used to create comments
print()
round()
%=
#
34. floor division AND assignment operator
argv
open()
//=
~
35. 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
~
input()
a//b
36. ,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.
readline
>>
else
37. The keyword beginning a header that will create a new function.
*
<<
def
append()
38. square root
math.sqrt(a)
>
>=
elif (Else if)
39. Prints a string to the screen which is converted using repr()
%r
print
%d
close
40. Symbol to multiply things
*
%=
**=
continue
41. turns an object into an integer
*read
int()
if
Variables
42. This keyword attempts to do something that would cause the program to crash if it were not for this statement.
format string
<<
try
class
43. This keyword begins the simplest form of a conditional statement.
%r
-=
*read
if
44. 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
<<
=
print
^
45. sets the file's current position
Variables
%s
int()
file.seek()
46. returns the length of a string (number of characters)
//=
format string
len()
^
47. Function to empty the contents of a file - no recovery is possible
<<
*
or
truncate
48. Function to open or read a file
open()
print()
%r
not in
49. writes stuff to the file
&
.py
file.write(stuff)
input()
50. Prints a string to the screen which is a signed decimal.
close
close
%d
**=