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. Reads the contents of the file you can assign the result to a variable.






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






3. turns an object into an integer






4. single line comment






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






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






7. Create a variable.






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






9. This statement causes an exception.






10. deletes an item from a list






11. absolute value






12. Adds something to a variable






13. assignment operator






14. writes stuff to the file






15. Greater than or equal symbol.






16. turns an object into a string






17. add AND assignment operator






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






19. exponentiation






20. Symbol to multiply things






21. Create a variable.






22. floor division






23. Function to write something to a file






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






25. Writes stuff to the file.






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






27. Less than or equal to symbol






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






29. A statement that breaks out of a loop.






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






31. End header line.






32. deletes an item from a list






33. reads just one line of a text file & keeps track of where in the file you're at






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






35. Turns a line into a comment instead of executable code.






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






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






38. prints its parameter to the console






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






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






41. Symbol used to create comments






42. subtract AND assignment operator






43. absolute value






44. exponentiation






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






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






47. Prevents a runtime error from stopping the program.






48. turns an object into a string






49. Symbol used to create comments






50. A statement that displays a value on the screen.