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. Command to print to the screen






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






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






4. exponent AND assignment operator






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






6. Argument variable






7. Greater than or equal symbol.






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






9. A data type for representing numbers with fractional values.






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






11. single line comment






12. square root






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






14. writes stuff to the file






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






16. Greater than symbol






17. Symbol to add things together






18. floor division AND assignment operator






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






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






21. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






22. Adds something to a variable






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






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






25. Symbol to multiply things






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






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






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






29. turns an object into a string






30. Symbol to add things together






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. Function to read the contents of a file






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






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






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






36. exponentiation






37. Symbol used to create comments






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






39. 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).






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






41. End header line.






42. End header line.






43. assignment operator






44. floor division






45. modulo






46. Function to open or read a file






47. prints its parameter to the console






48. floor division AND assignment operator






49. Command to print to the screen






50. subtract AND assignment operator