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. Turns a line into a comment instead of executable code.






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






3. absolute value






4. Less than symbol






5. Argument variable






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






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






8. exponentiation






9. Prevents a runtime error from stopping the program.






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






11. add AND assignment operator






12. This statement causes an exception.






13. Symbol to subtract things from each other






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






15. multiply AND assignment operator






16. adds an item to a list






17. Adds something to a variable






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






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






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






21. Greater than or equal symbol.






22. turns an object into a string






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






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






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






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






27. modulo






28. Create a variable.






29. Function to read the contents of a file






30. writes stuff to the file






31. floor division






32. unction to read one line of a file






33. Less than symbol






34. Command to print to the screen






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






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






37. turns an object into a string






38. Greater than symbol






39. modulus AND assignment operator






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






41. square root






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






43. exponent AND assignment operator






44. divide AND assignment operator






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






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






47. square root






48. Command to print to the screen






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






50. exponent AND assignment operator