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. This keyword in the body of a conditional allows chained conditionals.






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






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






4. prints its parameter to the console






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






6. divide AND assignment operator






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






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






9. Symbol to multiply things






10. multiply AND assignment operator






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






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






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






14. Less than symbol






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






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






17. Less than or equal to symbol






18. Argument variable






19. Greater than or equal symbol.






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






21. Function to open or read a file






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






23. unction to read one line of a file






24. Writes stuff to the file.






25. exponentiation






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






27. unction to read one line of a file






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






29. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






31. An operator to check whether two variables refer to the same object.






32. add AND assignment operator






33. The extension for Python scripts






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






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






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






37. Symbol to multiply things






38. Command to print to the screen






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






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






41. Less than or equal to symbol






42. Create a variable.






43. Symbol to add things together






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






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






46. single line comment






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






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






49. multiply AND assignment operator






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