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. Turns a line into a comment instead of executable code.






2. This statement causes an exception.






3. Less than or equal to symbol






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






5. turns an object into an integer






6. modulus AND assignment operator






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






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






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






10. subtract AND assignment operator






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






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






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






14. adds an item to a list






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






16. writes stuff to the file






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. Symbol used to create comments






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






20. floor division






21. adds an item to a list






22. Symbol to add things together






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






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






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






26. single line comment






27. Argument variable






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






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






30. Argument variable






31. floor division AND assignment operator






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






33. add AND assignment operator






34. prints its parameter to the console






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






36. exponentiation






37. Writes stuff to the file.






38. The extension for Python scripts






39. Symbol to add things together






40. square root






41. Greater than symbol






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






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






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






45. Less than or equal to symbol






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






47. empties the file






48. add AND assignment operator






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






50. Greater than symbol