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. Command to print to the screen






2. add AND assignment operator






3. modulo






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






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






6. A keyword that does nothing but fill space to indicate code which will be written later.






7. square root






8. exponent AND assignment operator






9. A statement that breaks out of a loop.






10. This keyword begins the simplest form of a conditional statement.






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






12. unction to read one line of a file






13. floor division






14. square root






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






16. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






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






18. A logical operator which requires two expressions to both be true.






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






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






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






22. Writes stuff to the file.






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






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






25. Greater than or equal symbol.






26. empties the file






27. Symbol to subtract things from each other






28. Less than or equal to symbol






29. adds an item to a list






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






31. floor division






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






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






34. Adds something to a variable






35. exponentiation






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






37. modulus AND assignment operator






38. A statement that assigns a value to a variable.






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






40. exponent AND assignment operator






41. Function to open or read a file






42. turns an object into a string






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






44. Greater than symbol






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






46. prints its parameter to the console






47. Symbol to subtract things from each other






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






49. divide AND assignment operator






50. assignment operator