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. A built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






2. A string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






3. An operator that removes a value from a list.






4. turns an object into a string






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






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






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






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






9. turns an object into an integer






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






11. Modulus operator. It's the remainder after division






12. Adds a new line character






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






14. Function to write something to a file






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






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






17. writes stuff to the file






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






19. Greater than or equal symbol.






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






21. exponentiation






22. A built-in function that converts its argument to a string.






23. deletes an item from a list






24. Symbol to subtract things from each other






25. Symbol to multiply things






26. Command to print to the screen






27. A statement that breaks out of a loop.






28. Function to read the contents of a file






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






30. A logical operator which compares two operands and produces True if they are equal and False otherwise






31. prints its parameter to the console






32. subtract AND assignment operator






33. Prints a string to the screen which will be Unicode.






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






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






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






37. Symbol used to create comments






38. A data type for representing numbers with fractional values.






39. Symbol to add things together






40. floor division






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






42. empties the file






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






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






45. Command to print to the screen






46. Writes stuff to the file.






47. Less than or equal to symbol






48. multiply AND assignment operator






49. square root






50. Greater than or equal symbol.