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 converts its argument to a string.






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






3. multiply AND assignment operator






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






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






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






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






8. floor division






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






10. Function to write something to a file






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






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






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






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






15. Command to print to the screen






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






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






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






19. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






20. Greater than or equal symbol.






21. deletes an item from a list






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






23. absolute value






24. floor division AND assignment operator






25. prints its parameter to the console






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






27. Greater than symbol






28. A statement that breaks out of a loop.






29. modulo






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






31. empties the file






32. The extension for Python scripts






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






34. Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. a >> 2 will give 15 which is 0000 1111






35. Symbol to multiply things






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






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






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






39. turns an object into a string






40. floor division






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






42. turns an object into an integer






43. writes stuff to the file






44. turns an object into an integer






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






46. Argument variable






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






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






49. Adds a new line character






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