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. prints its parameter to the console
print()
def
*=
if
2. Function to open or read a file
open()
#
write
//=
3. A logical operator which compares two operands and produces True if they are equal and False otherwise
print
==
file.seek()
%s
4. 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.
()
float
+
in
5. reads just one line of a text file & keeps track of where in the file you're at
-
<=
file.readline()
return
6. This statement causes an exception.
raise
()
#
:
7. An operator to check whether two variables refer to the same object.
>>
%
for
is
8. Function to close a file - it will not be able to be used again unless the file is opened.
close
.py
//=
print()
9. prints its parameter to the console
:
n
^
print()
10. This keyword in the body of a conditional allows chained conditionals.
*truncate
len()
%=
elif (Else if)
11. Modulus operator. It's the remainder after division
%d
argv
%
del
12. turns an object into an integer
int()
.py
%=
readline
13. square root
insert()
+
math.sqrt(a)
truncate
14. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111
readline
>>
+
()
15. The keyword beginning a header that will create a new function.
argv
def
*write(stuff)
int
16. ,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.
<=
&
round()
17. Create a variable.
%=
floating point number
=
#
18. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011
~
==
*readline
close
19. Writes stuff to the file.
truncate
n
*write(stuff)
argv
20. Greater than symbol
>
/=
|
**=
21. assignment operator
=
**=
==
open()
22. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
len()
and
<<
str()
23. A data type for representing numbers with fractional values.
floating point number
**=
=
pass
24. assignment operator
format string
.py
=
&
25. Prints a string to the screen which is a signed decimal.
%d
=
&
~
26. Greater than symbol
>
.py
*readline
n
27. Turns a line into a comment instead of executable code.
#
%d
=
del
28. Symbol to subtract things from each other
-
a**b
%r
while
29. asks the user for a response and returns that response
/
>=
input()
int
30. Function to empty the contents of a file - no recovery is possible
raise
truncate
+=
if
31. Greater than or equal symbol.
:
>=
insert()
int
32. Where the parameters go. A necessary punctuation after any function even if it's empty.
abs(a)
()
=
print
33. square root
//=
*
math.sqrt(a)
**=
34. multiply AND assignment operator
a//b
*=
&
*truncate
35. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
**=
pass
format string
/=
36. Symbol to multiply things
=
*
()
~
37. inserts an item inside a list at a certain index
insert()
a%b
^
*=
38. 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
&
^
floating point number
<<
39. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101
=
append()
|
print()
40. The extension for Python scripts
%s
math.sqrt(a)
.py
/
41. End header line.
/
|
continue
:
42. End header line.
continue
:
Variables
readline
43. A built-in function that converts integers and strings to floating-point numbers.
print
float
|
def
44. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.
def
else
int
%=
45. single line comment
n
file.readline()
<=
#
46. modulus AND assignment operator
print()
%=
int()
%s
47. Adds a new line character
n
<=
math.sqrt(a)
<
48. turns an object into an integer
int()
not
format string
-=
49. This keyword in the body of a conditional - gives an alternative execution.
del
*truncate
else
a%b
50. Symbol to divide by the number to the right of the symbol
%d
/
n
()