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. Empties the file - watch out if you care about the file.






2. exponentiation






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






4. modulus AND assignment operator






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






6. writes stuff to the file






7. square root






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






9. subtract AND assignment operator






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






11. assignment operator






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






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






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






15. multiply AND assignment operator






16. Adds a new line character






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






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






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






20. Greater than symbol






21. End header line.






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






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






24. Symbol used to create comments






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






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






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






28. This statement causes an exception.






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






30. Prevents a runtime error from stopping the program.






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






32. Function to read the contents of a file






33. End header line.






34. modulo






35. exponentiation






36. prints its parameter to the console






37. Create a variable.






38. Adds something to a variable






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






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. Symbol to divide by the number to the right of the symbol






42. deletes an item from a list






43. add AND assignment operator






44. Symbol to multiply things






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






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






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






48. turns an object into an integer






49. prints its parameter to the console






50. This statement exits a function. The remaining lines of the function are not executed.