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 its parameter to the console






2. adds an item to a list






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






4. Greater than or equal symbol.






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






6. Greater than or equal symbol.






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






8. The keyword beginning a header that will create a new function.






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






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






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






12. exponentiation






13. Function to read the contents of a file






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






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






16. floor division AND assignment operator






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






18. Adds a new line character






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






20. Command to print to the screen






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






22. Greater than symbol






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






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






25. multiply AND assignment operator






26. The keyword beginning a header that will create a new function.






27. assignment operator






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






29. deletes an item from a list






30. Argument variable






31. turns an object into an integer






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






33. A statement that breaks out of a loop.






34. modulus AND assignment operator






35. unction to read one line of a file






36. This statement causes an exception.






37. Less than symbol






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






39. Reads the contents of the file you can assign the result to a variable.






40. Create a variable.






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






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






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






44. exponent AND assignment operator






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






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






47. Reads just one line of a text file.






48. Command to print to the screen






49. turns an object into a string






50. Create a variable.