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 built-in function that converts its argument to a string.






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






3. unction to read one line of a file






4. Symbol to add things together






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






6. add AND assignment operator






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






8. turns an object into an integer






9. Symbol to subtract things from each other






10. Reads just one line of a text file.






11. writes stuff to the file






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






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






14. Symbol to multiply things






15. Empties the file - watch out if you care about the file.






16. Symbol to add things together






17. Symbol used to create comments






18. Symbol used to create comments






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






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






21. Adds a new line character






22. deletes an item from a list






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






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






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






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






27. modulus AND assignment operator






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






29. adds an item to a list






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






31. modulo






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






33. Greater than or equal symbol.






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






35. Less than symbol






36. floor division






37. Command to print to the screen






38. Greater than symbol






39. exponentiation






40. turns an object into an integer






41. Function to open or read a file






42. Argument variable






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






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






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






46. Adds a new line character






47. floor division AND assignment operator






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






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






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