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. Prints a string to the screen which will be Unicode.






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






3. The extension for Python scripts






4. Less than symbol






5. writes stuff to the file






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






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






8. floor division






9. Greater than or equal symbol.






10. assignment operator






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






12. Function to open or read a file






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






14. empties the file






15. floor division AND assignment operator






16. Symbol to subtract things from each other






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






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






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






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






21. Adds a new line character






22. modulo






23. exponentiation






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






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






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






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






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






29. Adds something to a variable






30. unction to read one line of a file






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






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






33. deletes an item from a list






34. Function to write something to a file






35. Create a variable.






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






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






38. unction to read one line of a file






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






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






41. modulo






42. Function to close a file - it will not be able to be used again unless the file is opened.






43. divide AND assignment operator






44. exponentiation






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






46. Adds a new line character






47. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






48. Prevents a runtime error from stopping the program.






49. Symbol to multiply things






50. This statement causes an exception.