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 boolean operator that takes two strings and returns True if the first appears as a substring in the second.






2. Less than symbol






3. A statement that breaks out of a loop.






4. unction to read one line of a file






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






6. Function to open or read a file






7. End header line.






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






9. divide AND assignment operator






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






11. absolute value






12. Symbol to multiply things






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






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






15. add AND assignment operator






16. assignment operator






17. turns an object into a string






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






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






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






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






22. turns an object into an integer






23. Adds a new line character






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






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






26. Function to open or read a file






27. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






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






29. adds an item to a list






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






31. absolute value






32. subtract AND assignment operator






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






34. floor division AND assignment operator






35. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






36. floor division






37. A logical operator which returns a value of True if either of the conditions is true.






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






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






40. Function to read the contents of a file






41. Reads just one line of a text file.






42. modulus AND assignment operator






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






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






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






46. The extension for Python scripts






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






48. A keyword that does nothing but fill space to indicate code which will be written later.






49. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






50. subtract AND assignment operator