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. The extension for Python scripts






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






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






4. This statement causes an exception.






5. Symbol used to create comments






6. Greater than symbol






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






8. exponentiation






9. Create a variable.






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






11. unction to read one line of a file






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






13. Command to print to the screen






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






15. multiply AND assignment operator






16. absolute value






17. Function to write something to a file






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






19. The extension for Python scripts






20. sets the file's current position






21. turns an object into a string






22. assignment operator






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






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






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






26. floor division AND assignment operator






27. modulo






28. This keyword creates a new class object which is a user-defined type - like a factory for creating objects.






29. turns an object into an integer






30. turns an object into an integer






31. exponent AND assignment operator






32. floor division AND assignment operator






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






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






35. Function to read the contents of a file






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






37. modulo






38. End header line.






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






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






41. Adds a new line character






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






43. Create a variable.






44. adds an item to a list






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






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






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






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






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






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







Sorry!:) No result found.

Can you answer 50 questions in 15 minutes?


Let me suggest you:



Major Subjects



Tests & Exams


AP
CLEP
DSST
GRE
SAT
GMAT

Most popular tests