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






2. Greater than or equal symbol.






3. empties the file






4. Argument variable






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






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






7. divide AND assignment operator






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






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






10. square root






11. assignment operator






12. Prevents a runtime error from stopping the program.






13. Writes stuff to the file.






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






15. Function to write something to a file






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






17. square root






18. floor division AND assignment operator






19. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






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






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






22. floor division AND assignment operator






23. The extension for Python scripts






24. turns an object into an integer






25. turns an object into a string






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






27. Function to read the contents of a file






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






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






30. divide AND assignment operator






31. Function to read the contents of a file






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






33. adds an item to a list






34. Adds something to a variable






35. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.






36. This keyword begins a header for a body that repeats until the condition is no longer true.






37. adds an item to a list






38. Symbol to add things together






39. deletes an item from a list






40. Greater than symbol






41. Symbol used to create comments






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






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






44. asks the user for a response and returns that response






45. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.






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






47. modulus AND assignment operator






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






49. add AND assignment operator






50. prints its parameter to the console