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. The extension for Python scripts






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






3. absolute value






4. unction to read one line of a file






5. Symbol used to create comments






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






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






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






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






10. turns an object into an integer






11. add AND assignment operator






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






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






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






15. Argument variable






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






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






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






19. Less than symbol






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






21. Symbol to multiply things






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






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






24. subtract AND assignment operator






25. This keyword begins a header for a body that repeats until the condition is no longer true.






26. divide AND assignment operator






27. End header line.






28. square root






29. modulus AND assignment operator






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






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






32. The extension for Python scripts






33. Symbol to add things together






34. multiply AND assignment operator






35. empties the file






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






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






38. square root






39. Command to print to the screen






40. Create a variable.






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






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






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






44. Writes stuff to the file.






45. sets the file's current position






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






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






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






49. deletes an item from a list






50. Argument variable