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. Argument variable






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






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






4. single line comment






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






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






7. Argument variable






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






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






10. sets the file's current position






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






12. floor division






13. deletes an item from a list






14. A built-in function that converts its argument to a string.






15. turns an object into a string






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






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






18. assignment operator






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






20. Symbol used to create comments






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






22. divide AND assignment operator






23. Function to read the contents of a file






24. Symbol to multiply things






25. Greater than or equal symbol.






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






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. This statement exits a function. The remaining lines of the function are not executed.






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






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






31. square root






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






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






34. Reads just one line of a text file.






35. Command to print to the screen






36. modulus AND assignment operator






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






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. Adds something to a variable






40. absolute value






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






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






43. assignment operator






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






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






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






47. Create a variable.






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






49. add AND assignment operator






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