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. 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.
class
close
input()
in
2. modulo
write
=
pass
a%b
3. Function to empty the contents of a file - no recovery is possible
truncate
a**b
%s
input()
4. turns an object into a string
truncate
str()
input()
file.truncate()
5. 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
int()
except
^
break
6. add AND assignment operator
write
*write(stuff)
+=
del
7. This statement exits a function. The remaining lines of the function are not executed.
read
-
a**b
return
8. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
is
%
class
in
9. Symbol used to create comments
append()
*write(stuff)
#
%
10. A logical operator which returns a value of True if either of the conditions is true.
*readline
close
or
&
11. rounds a number to the number of decimal points you choose
round()
def
readline
print()
12. Function to close a file - it will not be able to be used again unless the file is opened.
close
except
file.seek()
print()
13. A built-in function that converts integers and strings to floating-point numbers.
float
|
print
elif (Else if)
14. Argument variable
//=
argv
#
.py
15. Reads the contents of the file you can assign the result to a variable.
not
*
*read
()
16. modulus AND assignment operator
%=
n
/
+
17. Greater than symbol
>
write
a%b
len()
18. Greater than or equal symbol.
write
:
>=
/
19. assignment operator
:
write
=
float
20. returns the length of a string (number of characters)
len()
=
#
int()
21. Symbol to divide by the number to the right of the symbol
int()
/
=
file.readline()
22. Prints a string to the screen which is a signed decimal.
format string
and
%d
print()
23. A statement that assigns a value to a variable.
assignment
<<
=
write
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
^
=
str()
def
25. square root
read
a%b
math.sqrt(a)
+=
26. Argument variable
assignment
truncate
argv
format string
27. deletes an item from a list
=
>
print
del
28. A statement that ends the current iteration of a loop but continues looping.
=
continue
math.sqrt(a)
print
29. Function to open or read a file
-
open()
close
read
30. Where the parameters go. A necessary punctuation after any function even if it's empty.
==
()
return
in
31. multiply AND assignment operator
&
#
assignment
*=
32. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
format string
/=
math.sqrt(a)
int
33. prints its parameter to the console
+
%s
print()
file.truncate()
34. The extension for Python scripts
.py
read
*write(stuff)
Variables
35. This statement causes an exception.
~
raise
else
int
36. Less than symbol
<
math.sqrt(a)
float
==
37. returns the length of a string (number of characters)
>>
str()
len()
str
38. absolute value
<=
<
=
abs(a)
39. exponentiation
=
insert()
a**b
a%b
40. Prints a string to the screen which is converted using repr()
float
**=
%r
~
41. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.
argv
continue
==
in
42. Function to write something to a file
write
-
try
>=
43. Create a variable.
%=
~
raise
=
44. This keyword in the body of a conditional - gives an alternative execution.
else
print
close
int()
45. Symbol to add things together
+
write
n
.py
46. square root
<=
except
a%b
math.sqrt(a)
47. ,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.
^
a%b
+=
48. Adds something to a variable
=
*=
abs(a)
read
49. A logical operator which requires two expressions to both be true.
.py
and
+=
print()
50. Where the parameters go. A necessary punctuation after any function even if it's empty.
+
insert()
read
()