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 a string to the screen which is converted using repr()






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






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






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






5. Greater than or equal symbol.






6. modulus AND assignment operator






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






8. Command to print to the screen






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






10. adds an item to a list






11. Less than symbol






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






13. add AND assignment operator






14. turns an object into a string






15. divide AND assignment operator






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






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






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






19. Symbol used to create comments






20. Function to open or read a file






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






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






23. Empties the file - watch out if you care about the file.






24. modulus AND assignment operator






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






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






27. End header line.






28. exponentiation






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






30. unction to read one line of a file






31. Create a variable.






32. sets the file's current position






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






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






35. A logical operator which returns a value of True if either of the conditions is true.






36. Function to write something to a file






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






38. Function to read the contents of a file






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






40. divide AND assignment operator






41. Argument variable






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






43. floor division AND assignment operator






44. add AND assignment operator






45. Reads just one line of a text file.






46. square root






47. writes stuff to the file






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






49. subtract AND assignment operator






50. assignment operator