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. The extension for Python scripts






2. assignment operator






3. assignment operator






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






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






6. Function to write something to a file






7. A statement that breaks out of a loop.






8. Command to print to the screen






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






10. Symbol to add things together






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






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






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






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






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






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






17. Prevents a runtime error from stopping the program.






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






19. Less than or equal to symbol






20. floor division AND assignment operator






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






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






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






24. Argument variable






25. An operator to check whether two variables refer to the same object.






26. Symbol to subtract things from each other






27. prints its parameter to the console






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






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






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






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






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






33. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.






34. Adds something to a variable






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






36. A statement that assigns a value to a variable.






37. single line comment






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






39. Symbol to add things together






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






41. Symbol used to create comments






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






43. unction to read one line of a file






44. multiply AND assignment operator






45. Greater than or equal symbol.






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






47. Function to read the contents of a file






48. floor division AND assignment operator






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






50. Command to print to the screen