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. empties the file






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






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






4. modulo






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






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






7. Greater than symbol






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






9. floor division AND assignment operator






10. Function to close a file - it will not be able to be used again unless the file is opened.






11. Less than or equal to symbol






12. Less than or equal to symbol






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






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






15. Less than symbol






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






17. Function to write something to a file






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






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






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






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






22. deletes an item from a list






23. add AND assignment operator






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






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






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






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






28. Symbol used to create comments






29. Argument variable






30. deletes an item from a list






31. multiply AND assignment operator






32. A built-in function that converts its argument to a string.






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






34. divide AND assignment operator






35. absolute value






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






37. Prevents a runtime error from stopping the program.






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






39. square root






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






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






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






43. Greater than or equal symbol.






44. square root






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






46. Reads just one line of a text file.






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






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






49. Function to read the contents of a file






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