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. This keyword attempts to do something that would cause the program to crash if it were not for this statement.






3. Adds something to a variable






4. adds an item to a list






5. Greater than symbol






6. Argument variable






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






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






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






10. Function to write something to a file






11. Command to print to the screen






12. turns an object into a string






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






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






15. divide AND assignment operator






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






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






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






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






20. Symbol to multiply things






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






22. Symbol used to create comments






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






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






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






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






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






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






29. floor division






30. floor division AND assignment operator






31. exponentiation






32. absolute value






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






34. Function to open or read a file






35. Less than symbol






36. square root






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






38. Greater than or equal symbol.






39. single line comment






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






41. The extension for Python scripts






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






43. A logical operator which compares two operands and produces True if they are equal and False otherwise






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






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






46. divide AND assignment operator






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






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






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






50. floor division AND assignment operator