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. Symbol to divide by the number to the right of the symbol






2. Symbol to multiply things






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






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






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






6. adds an item to a list






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






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






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






10. turns an object into an integer






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






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






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






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






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






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






17. Argument variable






18. multiply AND assignment operator






19. exponentiation






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






21. Symbol used to create comments






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






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






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






25. writes stuff to the file






26. unction to read one line of a file






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






28. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






29. square root






30. Function to open or read a file






31. floor division






32. exponentiation






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






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






35. Prevents a runtime error from stopping the program.






36. Symbol to add things together






37. Less than symbol






38. absolute value






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






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






41. Greater than or equal symbol.






42. Command to print to the screen






43. Greater than or equal symbol.






44. modulus AND assignment operator






45. square root






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






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






48. exponent AND assignment operator






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






50. Function to write something to a file