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 logical operator which compares two operands and produces True if they are equal and False otherwise






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






3. Symbol used to create comments






4. modulus AND assignment operator






5. Create a variable.






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






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






8. floor division AND assignment operator






9. unction to read one line of a file






10. A statement that assigns a value to a variable.






11. Adds a new line character






12. prints its parameter to the console






13. prints its parameter to the console






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






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






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






17. Less than or equal to symbol






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






19. single line comment






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






21. Create a variable.






22. turns an object into a string






23. A statement that ends the current iteration of a loop but continues looping.






24. Function to read the contents of a file






25. deletes an item from a list






26. Turns a line into a comment instead of executable code.






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






28. End header line.






29. Greater than or equal symbol.






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






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






32. add AND assignment operator






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






34. turns an object into a string






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






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






37. Greater than or equal symbol.






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






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






40. Function to open or read a file






41. Function to open or read a file






42. Command to print to the screen






43. empties the file






44. writes stuff to the file






45. exponentiation






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






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






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






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






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