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. Greater than symbol






2. Adds a new line character






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






4. turns an object into a string






5. add AND assignment operator






6. Adds a new line character






7. subtract AND assignment operator






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






9. assignment operator






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






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






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






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






14. Symbol used to create comments






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






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






17. multiply AND assignment operator






18. Prevents a runtime error from stopping the program.






19. Adds something to a variable






20. Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y - here not in results in a 1 if x is a member of sequence y.






21. absolute value






22. Greater than or equal symbol.






23. Command to print to the screen






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






25. turns an object into an integer






26. Command to print to the screen






27. Symbol to subtract things from each other






28. A logical operator which requires two expressions to both be true.






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






30. Greater than symbol






31. sets the file's current position






32. floor division AND assignment operator






33. The extension for Python scripts






34. Less than or equal to symbol






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






36. exponentiation






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






38. Create a variable.






39. Greater than or equal symbol.






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






41. End header line.






42. Reads just one line of a text file.






43. exponentiation






44. empties the file






45. Argument variable






46. The extension for Python scripts






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






48. divide AND assignment operator






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






50. exponent AND assignment operator