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. Symbol to add things together






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






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






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






6. single line comment






7. Argument variable






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






9. divide AND assignment operator






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






11. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






12. Command to print to the screen






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






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






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






16. Greater than symbol






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






18. A logical operator which compares two operands and produces True if they are equal and False otherwise






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






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






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






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






23. Adds something to a variable






24. Greater than or equal symbol.






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






26. End header line.






27. Function to open or read a file






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






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






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






31. assignment operator






32. Command to print to the screen






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






34. square root






35. unction to read one line of a file






36. modulo






37. square root






38. subtract AND assignment operator






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






40. empties the file






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






42. A logical operator which compares two operands and produces True if they are equal and False otherwise






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






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






45. unction to read one line of a file






46. exponentiation






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






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






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






50. prints its parameter to the console