Test your basic knowledge |

Basic Python Programming

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. Function to read the contents of a file






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






3. Adds something to a variable






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






5. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101






6. Less than or equal to symbol






7. This statement exits a function. The remaining lines of the function are not executed.






8. Prints a string to the screen which is converted using repr()






9. End header line.






10. Symbol to divide by the number to the right of the symbol






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






12. Writes stuff to the file.






13. Function to write something to a file






14. Reads the contents of the file you can assign the result to a variable.






15. modulus AND assignment operator






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






17. An operator that removes a value from a list.






18. floor division






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






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






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






22. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






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






24. turns an object into an integer






25. divide AND assignment operator






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






27. Prints a string to the screen which is a signed decimal.






28. unction to read one line of a file






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






30. Binary OR Operator copies a bit if it exists in eather operand. (a | b) will give 61 which is 0011 1101






31. A statement that breaks out of a loop.






32. Less than symbol






33. exponent AND assignment operator






34. Command to print to the screen






35. modulo






36. Symbol to subtract things from each other






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






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






39. divide AND assignment operator






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






41. returns the length of a string (number of characters)






42. Adds something to a variable






43. floor division AND assignment operator






44. assignment operator






45. Reads just one line of a text file.






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






47. absolute value






48. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






49. A built-in function that converts its argument to a string.






50. turns an object into a string