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






2. add AND assignment operator






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






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






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






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






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






8. divide AND assignment operator






9. This statement causes an exception.






10. assignment operator






11. square root






12. Less than or equal to symbol






13. Symbol to add things together






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






15. Adds a new line character






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






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






18. Greater than or equal symbol.






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






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






21. Writes stuff to the file.






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






23. A statement that displays a value on the screen.






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






25. exponentiation






26. The extension for Python scripts






27. Command to print to the screen






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






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






30. Less than or equal to symbol






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






32. modulus AND assignment operator






33. floor division AND assignment operator






34. Adds something to a variable






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






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






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






38. floor division






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






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






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






42. empties the file






43. sets the file's current position






44. Function to write something to a file






45. exponent AND assignment operator






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






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






48. Symbol used to create comments






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






50. Function to open or read a file