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. A keyword that does nothing but fill space to indicate code which will be written later.






2. exponentiation






3. Adds a new line character






4. The keyword beginning a header that will create a loop.






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






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






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






8. empties the file






9. deletes an item from a list






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






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






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






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






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






15. floor division






16. Greater than or equal symbol.






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






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






19. Function to write something to a file






20. Less than symbol






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






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






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






24. The extension for Python scripts






25. square root






26. add AND assignment operator






27. Command to print to the screen






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






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






30. Symbol to add things together






31. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






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






34. modulus AND assignment operator






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






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






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






38. multiply AND assignment operator






39. Symbol to subtract things from each other






40. A built-in function that converts its argument to a string.






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






42. A statement that ends the current iteration of a loop but continues looping.






43. Create a variable.






44. exponent AND assignment operator






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






46. This statement exits a function. The remaining lines of the function are not executed.






47. Symbol to add things together






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






49. assignment operator






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