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






2. modulo






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






4. turns an object into a string






5. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001






6. add AND assignment operator






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






8. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






9. Symbol used to create comments






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






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






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






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






14. Argument variable






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






16. modulus AND assignment operator






17. Greater than symbol






18. Greater than or equal symbol.






19. assignment operator






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






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






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






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






24. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001






25. square root






26. Argument variable






27. deletes an item from a list






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






29. Function to open or read a file






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






31. multiply AND assignment operator






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






33. prints its parameter to the console






34. The extension for Python scripts






35. This statement causes an exception.






36. Less than symbol






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






38. absolute value






39. exponentiation






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






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






42. Function to write something to a file






43. Create a variable.






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






45. Symbol to add things together






46. square root






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






48. Adds something to a variable






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






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