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. unction to read one line of a file






2. subtract AND assignment operator






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






4. modulus AND assignment operator






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






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






7. This statement causes an exception.






8. Greater than or equal symbol.






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






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






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






12. The extension for Python scripts






13. square root






14. divide AND assignment operator






15. floor division






16. Function to read the contents of a file






17. Adds something to a variable






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






19. Prints a string to the screen which is a signed decimal.






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






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






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






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






24. Symbol to multiply things






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






26. Function to open or read a file






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






28. modulo






29. Function to read the contents of a file






30. square root






31. Less than or equal to symbol






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






33. writes stuff to the file






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






35. End header line.






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






37. modulus AND assignment operator






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






39. A statement that breaks out of a loop.






40. exponent AND assignment operator






41. adds an item to a list






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






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






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






45. Symbol to add things together






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






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






48. Function to open or read a file






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






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