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. Symbol to add things together






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






3. Command to print to the screen






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






5. exponentiation






6. Function to read the contents of a file






7. modulus AND assignment operator






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






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






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






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






12. absolute value






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






14. writes stuff to the file






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






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






17. exponentiation






18. square root






19. Less than or equal to symbol






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






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






22. Reads just one line of a text file.






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






24. absolute value






25. Function to write something to a file






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






27. turns an object into a string






28. turns an object into an integer






29. adds an item to a list






30. modulo






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






32. Adds something to a variable






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






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






35. Adds something to a variable






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






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






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






39. Function to open or read a file






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






41. Writes stuff to the file.






42. floor division AND assignment operator






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






44. divide AND assignment operator






45. Create a variable.






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






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






48. Greater than symbol






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






50. multiply AND assignment operator