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. Greater than symbol






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






3. floor division






4. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100






5. Argument variable






6. Greater than or equal symbol.






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






8. exponent AND assignment operator






9. Adds a new line character






10. Symbol to multiply things






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






12. Symbol used to create comments






13. Less than symbol






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






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






16. add AND assignment operator






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. returns the length of a string (number of characters)






19. floor division






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






21. multiply AND assignment operator






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






23. The extension for Python scripts






24. Reads just one line of a text file.






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






26. End header line.






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






28. Binary AND Operator copies a bit to the result if it exists in both operands. (a & b) will give 12 which is 0000 1100






29. absolute value






30. multiply AND assignment operator






31. divide AND assignment operator






32. prints its parameter to the console






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






34. unction to read one line of a file






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






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






37. End header line.






38. modulo






39. Symbol to add things together






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






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






42. square root






43. Prevents a runtime error from stopping the program.






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






45. subtract AND assignment operator






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






47. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






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






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






50. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.