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. Symbol to add things together






2. A logical operator which negates an expression so that it returns a value of True if the expression is false.






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






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






5. deletes an item from a list






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






7. unction to read one line of a file






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






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






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






11. exponent AND assignment operator






12. Symbol used to create comments






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






14. unction to read one line of a file






15. Symbol to subtract things from each other






16. square root






17. Function to open or read a file






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






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






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






21. Greater than symbol






22. Less than symbol






23. Greater than or equal symbol.






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






25. Argument variable






26. Create a variable.






27. prints its parameter to the console






28. absolute value






29. The extension for Python scripts






30. Symbol used to create comments






31. add AND assignment operator






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






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






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






35. Greater than symbol






36. Less than or equal to symbol






37. empties the file






38. This statement causes an exception.






39. assignment operator






40. single line comment






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






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






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






44. Symbol to multiply things






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






46. Argument variable






47. absolute value






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






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






50. modulo