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. A keyword that does nothing but fill space to indicate code which will be written later.
close
pass
del
*truncate
2. prints its parameter to the console
^
/=
print()
elif (Else if)
3. turns an object into an integer
/
int()
floating point number
*=
4. A logical operator which compares two operands and produces True if they are equal and False otherwise
continue
math.sqrt(a)
==
%=
5. asks the user for a response and returns that response
print
len()
=
input()
6. Adds a new line character
def
%r
n
assignment
7. Function to open or read a file
raise
()
open()
*
8. Prints a string to the screen which is converted using repr()
.py
abs(a)
%r
==
9. The keyword beginning a header that will create a new function.
print
**=
def
elif (Else if)
10. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
del
/
&
math.sqrt(a)
11. exponentiation
truncate
-=
~
a**b
12. absolute value
input()
<<
abs(a)
print
13. This keyword begins the simplest form of a conditional statement.
insert()
=
if
input()
14. Writes stuff to the file.
return
math.sqrt(a)
*write(stuff)
-=
15. 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
math.sqrt(a)
break
>
16. 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
int()
**=
file.truncate()
17. subtract AND assignment operator
:
-=
&
*write(stuff)
18. End header line.
%d
==
+=
:
19. asks the user for a response and returns that response
del
//=
input()
Variables
20. Symbol to divide by the number to the right of the symbol
<=
%=
/
write
21. Function to write something to a file
append()
write
<=
assignment
22. Function to empty the contents of a file - no recovery is possible
Variables
truncate
/=
#
23. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
str
Variables
%s
and
24. 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
print
a//b
^
/
25. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
print()
truncate
write
format string
26. 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
+=
()
while
27. A built-in function that converts its argument to a string.
str
def
readline
%
28. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
==
in
//=
*=
29. A logical operator which requires two expressions to both be true.
print
&
and
#
30. inserts an item inside a list at a certain index
/=
insert()
for
except
31. Prints a string to the screen which is a signed decimal.
is not
file.seek()
+
%d
32. deletes an item from a list
del
-
>=
%=
33. modulus AND assignment operator
%=
|
file.readline()
break
34. divide AND assignment operator
/=
=
a**b
break
35. This statement exits a function. The remaining lines of the function are not executed.
/=
return
|
close
36. modulo
a%b
==
file.seek()
-
37. ,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.
=
|
/
38. square root
if
=
math.sqrt(a)
or
39. Greater than or equal symbol.
^
^
:
>=
40. A statement that ends the current iteration of a loop but continues looping.
continue
argv
a**b
append()
41. Function to open or read a file
:
open()
file.write(stuff)
=
42. Symbol used to create comments
str()
<<
#
print
43. square root
file.write(stuff)
//=
*truncate
math.sqrt(a)
44. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100
=
print()
&
not in
45. prints its parameter to the console
%s
print()
float
a**b
46. returns the length of a string (number of characters)
write
is not
.py
len()
47. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
else
/
~
.py
48. Symbol to subtract things from each other
-
is not
readline
=
49. Create a variable.
+
del
=
argv
50. Where the parameters go. A necessary punctuation after any function even if it's empty.
//=
()
and