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






2. unction to read one line of a file






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






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






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






6. floor division AND assignment operator






7. This statement causes an exception.






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






9. A statement that assigns a value to a variable.






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






11. Writes stuff to the file.






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






13. Greater than or equal symbol.






14. Symbol to multiply things






15. empties the file






16. absolute value






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






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






19. assignment operator






20. unction to read one line of a file






21. Less than symbol






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






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






24. Symbol to add things together






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






26. A statement that breaks out of a loop.






27. exponent AND assignment operator






28. Function to read the contents of a file






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






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






31. Symbol to add things together






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






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






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






35. Function to open or read a file






36. End header line.






37. End header line.






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






39. Prevents a runtime error from stopping the program.






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






41. modulo






42. floor division AND assignment operator






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






44. Function to open or read a file






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






46. Command to print to the screen






47. subtract AND assignment operator






48. Symbol used to create comments






49. prints its parameter to the console






50. exponentiation







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