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. Prevents a runtime error from stopping the program.






2. sets the file's current position






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






4. multiply AND assignment operator






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






6. Symbol to multiply things






7. multiply AND assignment operator






8. Symbol used to create comments






9. Function to open or read a file






10. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






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






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






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






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






15. modulo






16. Writes stuff to the file.






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






18. turns an object into a string






19. turns an object into a string






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






21. Adds a new line character






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






23. add AND assignment operator






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






25. Function to read the contents of a file






26. Where the parameters go. A necessary punctuation after any function even if it's empty.






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






28. writes stuff to the file






29. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111






30. divide AND assignment operator






31. Less than symbol






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






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






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






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






36. exponent AND assignment operator






37. Command to print to the screen






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






39. An operator to check whether two variables refer to the same object.






40. exponent AND assignment operator






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






42. subtract AND assignment operator






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






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






45. Where the parameters go. A necessary punctuation after any function even if it's empty.






46. Adds something to a variable






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






48. floor division






49. Adds something to a variable






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