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






2. floor division






3. Greater than or equal symbol.






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






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






6. subtract AND assignment operator






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






8. turns an object into a string






9. modulo






10. divide AND assignment operator






11. assignment operator






12. unction to read one line of a file






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






14. This keyword begins the simplest form of a conditional statement.






15. Function to read the contents of a file






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






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






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






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






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






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






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






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






24. Symbol to multiply things






25. This keyword begins the simplest form of a conditional statement.






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






27. adds an item to a list






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






29. Symbol to subtract things from each other






30. square root






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






32. Adds a new line character






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






34. Function to open or read a file






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






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






37. Greater than symbol






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






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






40. sets the file's current position






41. Symbol to subtract things from each other






42. turns an object into a string






43. Adds something to a variable






44. A statement that breaks out of a loop.






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






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






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






48. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






49. Create a variable.






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