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






2. This statement causes an exception.






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






4. Adds something to a variable






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






6. turns an object into an integer






7. End header line.






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






9. Prevents a runtime error from stopping the program.






10. adds an item to a list






11. turns an object into a string






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






13. Function to open or read a file






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






15. turns an object into an integer






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






17. exponent AND assignment operator






18. unction to read one line of a file






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






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






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






22. multiply AND assignment operator






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






24. modulus AND assignment operator






25. unction to read one line of a file






26. assignment operator






27. absolute value






28. Adds something to a variable






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






30. Symbol to add things together






31. multiply AND assignment operator






32. Greater than symbol






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






34. Create a variable.






35. Symbol used to create comments






36. assignment operator






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






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






39. Function to read the contents of a file






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






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






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






43. modulo






44. Command to print to the screen






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






46. Argument variable






47. floor division AND assignment operator






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






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






50. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.