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 used to create comments






2. Less than symbol






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






4. square root






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






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






7. Symbol to multiply things






8. absolute value






9. Function to write something to a file






10. square root






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






12. Empties the file - watch out if you care about the file.






13. exponent AND assignment operator






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






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






16. Reads just one line of a text file.






17. End header line.






18. asks the user for a response and returns that response






19. prints its parameter to the console






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






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






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






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






24. Symbol to subtract things from each other






25. Symbol to multiply things






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






27. multiply AND assignment operator






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






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






30. End header line.






31. exponentiation






32. empties the file






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






34. exponentiation






35. divide AND assignment operator






36. Command to print to the screen






37. deletes an item from a list






38. A statement that breaks out of a loop.






39. divide AND assignment operator






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






41. A logical operator which negates an expression so that it returns a value of True if the expression is false.






42. Symbol to add things together






43. floor division AND assignment operator






44. Function to open or read a file






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






46. assignment operator






47. turns an object into a string






48. Less than symbol






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






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