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 string that begins with the % symbol and contains a sequence of printable characters and format specifiers that determine how values output should look.






2. Command to print to the screen






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






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






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






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






7. turns an object into a string






8. floor division AND assignment operator






9. Less than or equal to symbol






10. absolute value






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






12. Function to write something to a file






13. Adds something to a variable






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






15. Adds a new line character






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






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






18. add AND assignment operator






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






20. Turns a line into a comment instead of executable code.






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






22. Symbol to multiply things






23. single line comment






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






25. Adds a new line character






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






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






28. Function to read the contents of a file






29. turns an object into a string






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






31. This keyword in the body of a conditional allows chained conditionals.






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






33. modulus AND assignment operator






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






35. A statement that breaks out of a loop.






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






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






38. add AND assignment operator






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






40. adds an item to a list






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






42. End header line.






43. Reads just one line of a text file.






44. Symbol to multiply things






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






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






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






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






49. Create a variable.






50. modulo