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. A built-in function that converts its argument to a string.






2. unction to read one line of a file






3. Less than symbol






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






5. Argument variable






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






7. The extension for Python scripts






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






9. add AND assignment operator






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






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






12. Function to open or read a file






13. The extension for Python scripts






14. Greater than symbol






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






16. Symbol to add things together






17. Writes stuff to the file.






18. square root






19. divide AND assignment operator






20. Less than symbol






21. Less than or equal to symbol






22. Symbol to subtract things from each other






23. exponentiation






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






25. prints its parameter to the console






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






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






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






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






30. turns an object into a string






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






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






33. prints its parameter to the console






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






35. A statement that breaks out of a loop.






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






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






38. absolute value






39. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






40. Create a variable.






41. Function to write something to a file






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






43. divide AND assignment operator






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






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






46. Prevents a runtime error from stopping the program.






47. add AND assignment operator






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






49. writes stuff to the file






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