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. Function to write something to a file






2. subtract AND assignment operator






3. turns an object into a string






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






5. Less than or equal to symbol






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






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






8. Symbol used to create comments






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






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






11. Function to read the contents of a file






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






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






14. square root






15. Argument variable






16. assignment operator






17. Evaluates to true if it finds a variable in the specified sequence and false otherwise. x in y - here in results in a 1 if x is a member of sequence y.






18. exponent AND assignment operator






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






20. unction to read one line of a file






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






22. Adds a new line character






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






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






25. Symbol to add things together






26. Symbol to subtract things from each other






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






28. Symbol to multiply things






29. Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. x is not y - here is not results in 1 if id(x) is not equal to id(y).






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






31. add AND assignment operator






32. The extension for Python scripts






33. Less than symbol






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






35. This statement exits a function. The remaining lines of the function are not executed.






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






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






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






39. empties the file






40. unction to read one line of a file






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






42. Create a variable.






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






44. floor division






45. rounds a number to the number of decimal points you choose






46. exponentiation






47. floor division






48. Adds a new line character






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






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







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