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 Ones Complement Operator is unary and has the efect of 'flipping' bits. (~a ) will give -60 which is 1100 0011






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






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






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






5. absolute value






6. turns an object into an integer






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






8. Less than symbol






9. floor division






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






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. A logical operator which requires two expressions to both be true.






13. A logical operator which negates an expression so that it returns a value of True if the expression is false.






14. Adds something to a variable






15. Less than or equal to symbol






16. Symbol used to create comments






17. Greater than symbol






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






19. assignment operator






20. adds an item to a list






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






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






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






24. divide AND assignment operator






25. unction to read one line of a file






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






27. This statement causes an exception.






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






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






30. Function to open or read a file






31. Symbol to add things together






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






33. floor division AND assignment operator






34. Function to open or read a file






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






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






37. subtract AND assignment operator






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






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






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






41. Function to write something to a file






42. floor division






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






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






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






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






47. adds an item to a list






48. Adds a new line character






49. sets the file's current position






50. divide AND assignment operator