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. End header line.






2. deletes an item from a list






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






4. sets the file's current position






5. Adds a new line character






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






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






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






9. Less than symbol






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






11. Less than or equal to symbol






12. Less than symbol






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






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






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






16. exponent AND assignment operator






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






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






19. subtract AND assignment operator






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






21. prints its parameter to the console






22. floor division






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






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






25. multiply AND assignment operator






26. deletes an item from a list






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






28. Less than or equal to symbol






29. Command to print to the screen






30. exponentiation






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






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






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






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






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






36. Symbol used to create comments






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






38. multiply AND assignment operator






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






40. prints its parameter to the console






41. assignment operator






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






43. Function to open or read a file






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






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






46. unction to read one line of a file






47. Symbol to subtract things from each other






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






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






50. The extension for Python scripts