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. divide AND assignment operator






2. exponentiation






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






4. Adds a new line character






5. Argument variable






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






7. modulo






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






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






10. adds an item to a list






11. multiply AND assignment operator






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






13. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






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






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






17. Function to open or read a file






18. Create a variable.






19. sets the file's current position






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






21. subtract AND assignment operator






22. Less than or equal to symbol






23. A statement that ends the current iteration of a loop but continues looping.






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






25. deletes an item from a list






26. Symbol to add things together






27. add AND assignment operator






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






29. Command to print to the screen






30. turns an object into a string






31. Reads just one line of a text file.






32. square root






33. unction to read one line of a file






34. Writes stuff to the file.






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






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






37. Create a variable.






38. turns an object into an integer






39. turns an object into an integer






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






41. Less than symbol






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






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






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






45. assignment operator






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






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






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






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






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