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. Function to open or read a file






3. Symbol to add things together






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






5. turns an object into a string






6. Less than symbol






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






8. deletes an item from a list






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






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






11. turns an object into a string






12. Symbol to subtract things from each other






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






14. This keyword begins a header for a body that repeats until the condition is no longer true.






15. Symbol to subtract things from each other






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






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






18. A built-in function that converts integers and strings to floating-point numbers.






19. writes stuff to the file






20. square root






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






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






23. empties the file






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






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






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






27. Function to write something to a file






28. End header line.






29. The extension for Python scripts






30. Prevents a runtime error from stopping the program.






31. sets the file's current position






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






33. Greater than symbol






34. Adds a new line character






35. floor division






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






37. prints its parameter to the console






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






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






40. divide AND assignment operator






41. Reads just one line of a text file.






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






43. single line comment






44. Function to read the contents of a file






45. modulus AND assignment operator






46. Command to print to the screen






47. exponentiation






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






49. modulus AND assignment operator






50. Function to read the contents of a file







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