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. An operator that removes a value from a list.






2. Create a variable.






3. single line comment






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






5. modulus AND assignment operator






6. Less than symbol






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






8. A built-in function that converts integers and strings to floating-point numbers.






9. Command to print to the screen






10. exponent AND assignment operator






11. turns an object into a string






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






13. prints its parameter to the console






14. square root






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






16. divide AND assignment operator






17. exponentiation






18. Create a variable.






19. add AND assignment operator






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. This keyword in the body of a conditional - gives an alternative execution.






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






23. End header line.






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






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






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






27. Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. a << 2 will give 240 which is 1111 0000






28. Symbol to add things together






29. square root






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






31. Symbol to multiply things






32. Reads just one line of a text file.






33. This keyword in the body of a conditional - gives an alternative execution.






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






35. subtract AND assignment operator






36. multiply AND assignment operator






37. Symbol to multiply things






38. writes stuff to the file






39. Greater than symbol






40. Function to write something to a file






41. assignment operator






42. Symbol to add things together






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






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






45. unction to read one line of a file






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






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






48. floor division AND assignment operator






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






50. Adds a new line character