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. Command to print to the screen






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






3. writes stuff to the file






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






5. absolute value






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






7. prints its parameter to the console






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






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






10. Function to read the contents of a file






11. deletes an item from a list






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






13. square root






14. Symbol to multiply things






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






16. floor division AND assignment operator






17. modulus AND assignment operator






18. Less than symbol






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






20. Symbol to add things together






21. Create a variable.






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






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






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






25. Symbol to multiply things






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






27. Greater than or equal symbol.






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






29. Function to read the contents of a file






30. sets the file's current position






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






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






33. exponent AND assignment operator






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






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






36. End header line.






37. exponentiation






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






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






40. The extension for Python scripts






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






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






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






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






45. Greater than or equal symbol.






46. assignment operator






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






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






49. add AND assignment operator






50. floor division