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. Symbol to divide by the number to the right of the symbol






2. Adds something to a variable






3. add AND assignment operator






4. exponentiation






5. modulus AND assignment operator






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






7. Command to print to the screen






8. Function to write something to a file






9. Symbol to subtract things from each other






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






11. unction to read one line of a file






12. Turns a line into a comment instead of executable code.






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






14. subtract AND assignment operator






15. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






16. turns an object into an integer






17. sets the file's current position






18. subtract AND assignment operator






19. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






20. square root






21. Symbol to multiply things






22. turns an object into a string






23. Function to open or read a file






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






25. single line comment






26. The keyword beginning a header that will create a loop.






27. Adds a new line character






28. divide AND assignment operator






29. prints its parameter to the console






30. floor division






31. Create a variable.






32. Less than symbol






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






34. absolute value






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






36. Function to open or read a file






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






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






39. square root






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






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






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






43. multiply AND assignment operator






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






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






46. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






47. modulus AND assignment operator






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






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






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