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






2. subtract AND assignment operator






3. adds an item to a list






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






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






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






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






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






9. multiply AND assignment operator






10. Function to write something to a file






11. single line comment






12. turns an object into a string






13. Less than or equal to symbol






14. Symbol used to create comments






15. deletes an item from a list






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






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






18. Symbol to subtract things from each other






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






20. Less than symbol






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






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






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






24. Greater than symbol






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






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






27. add AND assignment operator






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






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






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






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






32. exponentiation






33. A logical operator which negates an expression so that it returns a value of True if the expression is false.






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






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






36. Symbol to multiply things






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






38. A statement that breaks out of a loop.






39. Create a variable.






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






41. absolute value






42. square root






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






44. floor division AND assignment operator






45. modulo






46. Symbol to add things together






47. Adds something to a variable






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






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






50. subtract AND assignment operator