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. End header line.






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






3. Greater than or equal symbol.






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






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






6. floor division






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






8. exponent AND assignment operator






9. deletes an item from a list






10. turns an object into an integer






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






12. Less than symbol






13. empties the file






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






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






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






17. Greater than symbol






18. turns an object into a string






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






20. deletes an item from a list






21. exponent AND assignment operator






22. multiply AND assignment operator






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






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






25. Function to read the contents of a file






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






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






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






29. absolute value






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






31. prints its parameter to the console






32. Adds something to a variable






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






34. square root






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






36. Symbol to subtract things from each other






37. assignment operator






38. adds an item to a list






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






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






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






42. Less than or equal to symbol






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






44. modulus AND assignment operator






45. The keyword beginning a header that will create a new function.






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






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






48. End header line.






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






50. Command to print to the screen