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. asks the user for a response and returns that response






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






3. Adds something to a variable






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






5. modulus AND assignment operator






6. square root






7. A statement that displays a value on the screen.






8. Symbol to add things together






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






10. This statement causes an exception.






11. Create a variable.






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






13. Greater than symbol






14. Less than symbol






15. multiply AND assignment operator






16. exponentiation






17. An operator that removes a value from a list.






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






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






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






21. Argument variable






22. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






24. modulo






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






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






27. Less than or equal to symbol






28. turns an object into a string






29. End header line.






30. floor division






31. turns an object into a string






32. floor division






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






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






35. Function to open or read a file






36. assignment operator






37. Command to print to the screen






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






39. prints its parameter to the console






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






41. Adds a new line character






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






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






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






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






46. add AND assignment operator






47. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






48. single line comment






49. prints its parameter to the console






50. floor division AND assignment operator