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. Reads the contents of the file you can assign the result to a variable.
<<
*write(stuff)
*read
a//b
2. Prints a string to the screen which is converted using repr()
%
open()
del
%r
3. turns an object into an integer
open()
>=
int()
%
4. single line comment
class
*
if
#
5. Prints a string to the screen which is converted using repr()
a%b
%=
file.write(stuff)
%r
6. An operator that removes a value from a list.
#
print
int()
del
7. Create a variable.
*write(stuff)
*
:
=
8. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.
read
format string
%
%s
9. This statement causes an exception.
=
a%b
a//b
raise
10. deletes an item from a list
del
&
if
()
11. absolute value
read
%r
*=
abs(a)
12. Adds something to a variable
=
a//b
argv
*
13. assignment operator
int()
=
insert()
readline
14. writes stuff to the file
>
file.write(stuff)
class
assignment
15. Greater than or equal symbol.
+=
>=
math.sqrt(a)
%
16. turns an object into a string
str()
*truncate
<<
and
17. add AND assignment operator
**=
in
*=
+=
18. returns the length of a string (number of characters)
#
len()
*
input()
19. exponentiation
()
a//b
elif (Else if)
a**b
20. Symbol to multiply things
file.seek()
*=
str
*
21. Create a variable.
file.readline()
>>
Variables
=
22. floor division
&
a//b
file.seek()
>
23. Function to write something to a file
**=
write
%
assignment
24. Function to empty the contents of a file - no recovery is possible
truncate
len()
return
^
25. Writes stuff to the file.
*write(stuff)
while
int
>
26. 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
<<
*=
>>
27. Less than or equal to symbol
%=
<=
argv
=
28. Prints a string to the screen which is a signed decimal.
%d
*readline
<=
print()
29. A statement that breaks out of a loop.
abs(a)
~
file.readline()
break
30. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.
>>
class
+
input()
31. End header line.
:
/
=
#
32. deletes an item from a list
argument variable
del
Variables
:
33. reads just one line of a text file & keeps track of where in the file you're at
=
/
file.readline()
break
34. Where the parameters go. A necessary punctuation after any function even if it's empty.
print
()
raise
%s
35. Turns a line into a comment instead of executable code.
+
:
#
in
36. Empties the file - watch out if you care about the file.
write
*truncate
round()
close
37. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.
-=
a//b
Variables
|
38. prints its parameter to the console
and
file.truncate()
*readline
print()
39. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.
<<
n
argument variable
and
40. 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
^
=
%
class
41. Symbol used to create comments
append()
>>
#
str
42. subtract AND assignment operator
//=
return
-=
#
43. absolute value
abs(a)
and
a**b
is
44. exponentiation
a**b
//=
append()
>
45. This keyword begins the simplest form of a conditional statement.
truncate
.py
%d
if
46. 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
#
>>
=
insert()
47. Prevents a runtime error from stopping the program.
except
%s
argv
class
48. turns an object into a string
%d
str()
*=
~
49. Symbol used to create comments
else
**=
%r
#
50. A statement that displays a value on the screen.
print
>=
==
/=