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. deletes an item from a list






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






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






4. add AND assignment operator






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






6. Function to read the contents of a file






7. Create a variable.






8. multiply AND assignment operator






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






10. exponent AND assignment operator






11. modulus AND assignment operator






12. deletes an item from a list






13. divide AND assignment operator






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






15. Prints a string to the screen which is converted using repr()






16. turns an object into an integer






17. exponentiation






18. Symbol to multiply things






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






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






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






22. Adds something to a variable






23. multiply AND assignment operator






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






25. sets the file's current position






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






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






28. Function to open or read a file






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






30. Function to read the contents of a file






31. add AND assignment operator






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






33. Symbol used to create comments






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






35. Less than or equal to symbol






36. Greater than or equal symbol.






37. Create a variable.






38. Adds something to a variable






39. modulo






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. Writes stuff to the file.






42. Greater than or equal symbol.






43. Command to print to the screen






44. Reads just one line of a text file.






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






46. turns an object into a string






47. square root






48. The keyword beginning a header that will create a loop.






49. modulus AND assignment operator






50. adds an item to a list