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. Function to write something to a file






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






3. multiply AND assignment operator






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






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






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






7. Command to print to the screen






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






9. Function to read the contents of a file






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






11. turns an object into a string






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






13. turns an object into an integer






14. exponentiation






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






16. Less than symbol






17. subtract AND assignment operator






18. square root






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






20. Less than or equal to symbol






21. unction to read one line of a file






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






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






24. Greater than symbol






25. Adds a new line character






26. add AND assignment operator






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






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






29. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






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






31. Adds something to a variable






32. Symbol to add things together






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






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






35. adds an item to a list






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






37. Symbol used to create comments






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






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






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






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






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






43. A boolean operator that takes two strings and returns True if the first appears as a substring in the second.






44. Reads the contents of the file you can assign the result to a variable.






45. modulo






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






47. Argument variable






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






49. Symbol to add things together






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