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. multiply AND assignment operator






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






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






4. sets the file's current position






5. divide AND assignment operator






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






7. adds an item to a list






8. A data type for representing numbers with fractional values.






9. reads just one line of a text file & keeps track of where in the file you're at






10. turns an object into an integer






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






12. floor division AND assignment operator






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






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






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






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






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






18. turns an object into a string






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






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






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






22. Symbol used to create comments






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






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






25. absolute value






26. Adds something to a variable






27. multiply AND assignment operator






28. prints its parameter to the console






29. Less than symbol






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






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






32. Create a variable.






33. square root






34. turns an object into an integer






35. absolute value






36. Symbol to subtract things from each other






37. Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






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






39. modulo






40. modulus AND assignment operator






41. Symbol to multiply things






42. Symbol to subtract things from each other






43. Greater than symbol






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






45. Symbol to multiply things






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






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






48. Symbol to add things together






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






50. unction to read one line of a file