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 logical operator which compares two operands and produces True if they are equal and False otherwise






2. exponent AND assignment operator






3. Less than or equal to symbol






4. prints its parameter to the console






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






6. A statement that breaks out of a loop.






7. modulo






8. Symbol to subtract things from each other






9. End header line.






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






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






12. deletes an item from a list






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






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






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






16. adds an item to a list






17. add AND assignment operator






18. Argument variable






19. Less than or equal to symbol






20. square root






21. Writes stuff to the file.






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






23. sets the file's current position






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






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






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






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






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






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






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






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






32. exponentiation






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






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






35. exponent AND assignment operator






36. floor division






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






38. Greater than or equal symbol.






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






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






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






42. turns an object into an integer






43. floor division AND assignment operator






44. Command to print to the screen






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






46. Function to read the contents of a file






47. This keyword begins a header for a body that repeats until the condition is no longer true.






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






49. Symbol to add things together






50. floor division