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






2. Greater than symbol






3. deletes an item from a list






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






5. Create a variable.






6. writes stuff to the file






7. Symbol to multiply things






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






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






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






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






12. Symbol to subtract things from each other






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






14. unction to read one line of a file






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






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






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






18. Adds something to a variable






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






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






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






22. exponent AND assignment operator






23. multiply AND assignment operator






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






25. A statement that breaks out of a loop.






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






27. exponentiation






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






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






30. Function to write something to a file






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






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






33. single line comment






34. Prevents a runtime error from stopping the program.






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






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






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






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






39. sets the file's current position






40. exponentiation






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






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






43. Empties the file - watch out if you care about the file.






44. add AND assignment operator






45. divide AND assignment operator






46. End header line.






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






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






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






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