Test your basic knowledge |

Basic Python Programming

Subject : it-skills
  • 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. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101

2. Greater than or equal symbol.

3. turns an object into a string

4. sets the file's current position

5. deletes an item from a list

6. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.

7. absolute value

8. This keyword attempts to do something that would cause the program to crash if it were not for this statement.

9. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.

10. divide AND assignment operator

11. 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

12. Function to write something to a file

13. rounds a number to the number of decimal points you choose

14. Prints a string to the screen which will be Unicode.

15. inserts an item inside a list at a certain index

16. Modulus operator. It's the remainder after division

17. Adds something to a variable

18. square root

19. Symbol to subtract things from each other

20. deletes an item from a list

21. A data type for representing numbers with fractional values.

22. adds an item to a list

23. adds an item to a list

24. Function to close a file - it will not be able to be used again unless the file is opened.

25. This keyword in the body of a conditional allows chained conditionals.

26. A statement that displays a value on the screen.

27. Symbol to multiply things

28. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100

29. Greater than symbol

30. Function to empty the contents of a file - no recovery is possible

31. Command to print to the screen

32. reads just one line of a text file & keeps track of where in the file you're at

33. Greater than symbol

34. The keyword beginning a header that will create a new function.

35. The extension for Python scripts

36. 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

37. A logical operator which compares two operands and produces True if they are equal and False otherwise

38. modulus AND assignment operator

39. An operator to check whether two variables refer to the same object.

40. This statement causes an exception.

41. exponent AND assignment operator

42. Symbol used to create comments

43. Create a variable.

44. The extension for Python scripts

45. Less than symbol

46. inserts an item inside a list at a certain index

47. Where the parameters go. A necessary punctuation after any function even if it's empty.

48. unction to read one line of a file

49. A logical operator which returns a value of True if either of the conditions is true.

50. ,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.