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. absolute value






2. Symbol to subtract things from each other






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






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






5. turns an object into an integer






6. Symbol to add things together






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






8. Less than or equal to symbol






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






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






11. floor division






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






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






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






15. Create a variable.






16. unction to read one line of a file






17. Adds a new line character






18. End header line.






19. floor division






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






21. sets the file's current position






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






23. turns an object into a string






24. Greater than symbol






25. Create a variable.






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






27. exponentiation






28. subtract AND assignment operator






29. The extension for Python scripts






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






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






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






33. Greater than or equal symbol.






34. Argument variable






35. empties the file






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






37. multiply AND assignment operator






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






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






40. modulo






41. Symbol to multiply things






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






43. Command to print to the screen






44. Greater than or equal symbol.






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






46. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






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






48. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






49. Greater than symbol






50. divide AND assignment operator