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. deletes an item from a list






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






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






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






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






6. subtract AND assignment operator






7. Adds something to a variable






8. This statement exits a function. The remaining lines of the function are not executed.






9. Symbol to subtract things from each other






10. Where the parameters go. A necessary punctuation after any function even if it's empty.






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






12. divide AND assignment operator






13. Function to write something to a file






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






15. Argument variable






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






17. divide AND assignment operator






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






19. modulo






20. Adds something to a variable






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






22. Greater than symbol






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






24. modulo






25. exponentiation






26. Command to print to the screen






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






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






29. Argument variable






30. square root






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






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






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






34. assignment operator






35. Writes stuff to the file.






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






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






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






39. floor division






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






41. multiply AND assignment operator






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






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






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






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






46. Less than symbol






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






48. The extension for Python scripts






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






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