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 logical operator which compares two operands and produces True if they are equal and False otherwise
==
-
int
>>
2. A logical operator which returns a value of True if either of the conditions is true.
or
input()
len()
%s
3. Greater than symbol
+=
^
>
%
4. Symbol used to create comments
round()
write
argv
#
5. This statement exits a function. The remaining lines of the function are not executed.
=
return
insert()
print
6. Where the parameters go. A necessary punctuation after any function even if it's empty.
len()
()
or
file.seek()
7. add AND assignment operator
*truncate
file.write(stuff)
%r
+=
8. subtract AND assignment operator
def
-=
#
<<
9. subtract AND assignment operator
>=
-=
and
round()
10. assignment operator
def
>
=
continue
11. multiply AND assignment operator
|
<=
*=
math.sqrt(a)
12. Symbol to divide by the number to the right of the symbol
for
in
print
/
13. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
file.seek()
:
^
in
14. turns an object into an integer
elif (Else if)
%=
int()
math.sqrt(a)
15. Symbol used to create comments
^
#
:
==
16. deletes an item from a list
format string
del
if
round()
17. turns an object into a string
close
==
str()
del
18. Empties the file - watch out if you care about the file.
*truncate
%r
round()
>>
19. Prevents a runtime error from stopping the program.
del
except
abs(a)
a**b
20. Function to close a file - it will not be able to be used again unless the file is opened.
:
a**b
close
%s
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
==
print
<<
=
22. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
//=
*=
class
not
23. Writes stuff to the file.
*write(stuff)
read
<
%r
24. modulus AND assignment operator
except
==
%=
=
25. floor division AND assignment operator
file.seek()
#
format string
//=
26. Turns a line into a comment instead of executable code.
~
=
#
()
27. asks the user for a response and returns that response
round()
not in
input()
()
28. divide AND assignment operator
=
/=
input()
print()
29. Function to empty the contents of a file - no recovery is possible
round()
int()
truncate
%
30. deletes an item from a list
del
readline
for
n
31. Argument variable
*
|
%s
argv
32. Prints a string to the screen which is a signed decimal.
open()
*
%d
.py
33. floor division
a//b
input()
open()
break
34. Greater than or equal symbol.
input()
open()
Variables
>=
35. An operator to check whether two variables refer to the same object.
<<
truncate
>=
is
36. Function to read the contents of a file
//=
in
-
read
37. This keyword in the body of a conditional - gives an alternative execution.
len()
^
>=
else
38. This keyword begins the simplest form of a conditional statement.
insert()
and
if
<<
39. Symbol to subtract things from each other
readline
readline
+
-
40. single line comment
input()
#
print
abs(a)
41. Command to print to the screen
print
except
int()
not
42. 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.
-
#
insert()
in
43. Reads the contents of the file you can assign the result to a variable.
.py
>
*read
:
44. A statement that displays a value on the screen.
>>
print
~
==
45. Function to open or read a file
*truncate
|
open()
math.sqrt(a)
46. End header line.
%d
:
/
insert()
47. Function to write something to a file
write
class
del
if
48. square root
abs(a)
*read
math.sqrt(a)
format string
49. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
str()
file.readline()
<<
and
50. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
argv
**=
=
~