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. prints its parameter to the console






2. Function to open or read a file






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






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






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






6. This statement causes an exception.






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






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






9. prints its parameter to the console






10. This keyword in the body of a conditional allows chained conditionals.






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






12. turns an object into an integer






13. square root






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






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






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






17. Create a variable.






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






19. Writes stuff to the file.






20. Greater than symbol






21. assignment operator






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






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






24. assignment operator






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






26. Greater than symbol






27. Turns a line into a comment instead of executable code.






28. Symbol to subtract things from each other






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






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






31. Greater than or equal symbol.






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






33. square root






34. multiply AND assignment operator






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






36. Symbol to multiply things






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






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






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






40. The extension for Python scripts






41. End header line.






42. End header line.






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






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






45. single line comment






46. modulus AND assignment operator






47. Adds a new line character






48. turns an object into an integer






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






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