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. This keyword begins the simplest form of a conditional statement.






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






3. Symbol used to create comments






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






5. Less than symbol






6. Function to empty the contents of a file - no recovery is possible






7. unction to read one line of a file






8. Symbol used to create comments






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






10. writes stuff to the file






11. turns an object into an integer






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






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






14. add AND assignment operator






15. Function to write something to a file






16. Symbol to multiply things






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






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






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






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






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






22. End header line.






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






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






25. reads just one line of a text file & keeps track of where in the file you're at






26. modulo






27. divide AND assignment operator






28. divide AND assignment operator






29. Function to read the contents of a file






30. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






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






33. Less than symbol






34. Adds something to a variable






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






36. modulo






37. exponent AND assignment operator






38. Create a variable.






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






40. turns an object into an integer






41. prints its parameter to the console






42. Function to open or read a file






43. floor division AND assignment operator






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






45. Function to open or read a file






46. Adds a new line character






47. Prevents a runtime error from stopping the program.






48. subtract AND assignment operator






49. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001






50. Writes stuff to the file.