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






2. Adds a new line character






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






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






5. Symbol used to create comments






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






7. empties the file






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






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






10. Symbol to divide by the number to the right of the symbol






11. Prevents a runtime error from stopping the program.






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






13. A statement that assigns a value to a variable.






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






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






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






17. square root






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






19. Less than or equal to symbol






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






21. divide AND assignment operator






22. square root






23. floor division AND assignment operator






24. Adds something to a variable






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






26. Symbol to divide by the number to the right of the symbol






27. deletes an item from a list






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






29. divide AND assignment operator






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






31. Function to write something to a file






32. unction to read one line of a file






33. A logical operator which requires two expressions to both be true.






34. sets the file's current position






35. A logical operator which negates an expression so that it returns a value of True if the expression is false.






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






37. The extension for Python scripts






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






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






40. single line comment






41. adds an item to a list






42. prints its parameter to the console






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






44. Function to read the contents of a file






45. modulo






46. modulo






47. Function to write something to a file






48. assignment operator






49. Function to open or read a file






50. Command to print to the screen






Can you answer 50 questions in 15 minutes?



Let me suggest you:



Major Subjects



Tests & Exams


AP
CLEP
DSST
GRE
SAT
GMAT

Most popular tests