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






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






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






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






5. turns an object into a string






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






7. Less than or equal to symbol






8. square root






9. reads just one line of a text file & keeps track of where in the file you're at






10. Greater than symbol






11. deletes an item from a list






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






13. exponentiation






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






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






16. Symbol used to create comments






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






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






19. Symbol to multiply things






20. multiply AND assignment operator






21. exponentiation






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






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






24. Symbol to subtract things from each other






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






26. Greater than or equal symbol.






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






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






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






30. modulus AND assignment operator






31. deletes an item from a list






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






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






34. floor division






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






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






37. The extension for Python scripts






38. single line comment






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






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






41. Reads just one line of a text file.






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






43. Prevents a runtime error from stopping the program.






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






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






46. Command to print to the screen






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






48. floor division AND assignment operator






49. assignment operator






50. Greater than symbol