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. Prevents a runtime error from stopping the program.






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






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






4. Create a variable.






5. turns an object into a string






6. prints its parameter to the console






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






8. Adds something to a variable






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






10. The extension for Python scripts






11. floor division






12. floor division






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






14. add AND assignment operator






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






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






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






18. exponent AND assignment operator






19. single line comment






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






21. Create a variable.






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






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






24. unction to read one line of a file






25. Symbol to multiply things






26. A statement that breaks out of a loop.






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






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






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






30. Function to write something to a file






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






32. adds an item to a list






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






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






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






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






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






38. writes stuff to the file






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






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






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






42. turns an object into an integer






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






44. turns an object into an integer






45. prints its parameter to the console






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






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






48. subtract AND assignment operator






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






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