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 an object into a string






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






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






4. Function to write something to a file






5. modulo






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






7. absolute value






8. exponentiation






9. assignment operator






10. add AND assignment operator






11. Greater than symbol






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






13. modulo






14. subtract AND assignment operator






15. Adds something to a variable






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






17. Greater than or equal symbol.






18. modulus AND assignment operator






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






20. prints its parameter to the console






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






22. Adds a new line character






23. prints its parameter to the console






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






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






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






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






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






29. End header line.






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






31. The extension for Python scripts






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






33. single line comment






34. deletes an item from a list






35. Turns a line into a comment instead of executable code.






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






37. inserts an item inside a list at a certain index






38. turns an object into an integer






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






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






41. writes stuff to the file






42. Argument variable






43. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






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






45. Reads just one line of a text file.






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






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






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






49. deletes an item from a list






50. Reads the contents of the file you can assign the result to a variable.






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