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. Create a variable.






2. Reads just one line of a text file.






3. Symbol to multiply things






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






5. assignment operator






6. The extension for Python scripts






7. multiply AND assignment operator






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






9. Function to open or read a file






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






11. sets the file's current position






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






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






14. Adds something to a variable






15. Writes stuff to the file.






16. Greater than symbol






17. subtract AND assignment operator






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






19. square root






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






21. deletes an item from a list






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






23. empties the file






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






25. Adds something to a variable






26. The extension for Python scripts






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






28. Command to print to the screen






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






30. deletes an item from a list






31. multiply AND assignment operator






32. floor division






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






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






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






36. single line comment






37. Greater than or equal symbol.






38. End header line.






39. modulus AND assignment operator






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






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






42. Argument variable






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






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






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






46. turns an object into an integer






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






48. writes stuff to the file






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






50. Less than or equal to symbol