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. prints its parameter to the console






2. assignment operator






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






4. multiply AND assignment operator






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






6. Less than or equal to symbol






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






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






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






10. Function to write something to a file






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






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






13. sets the file's current position






14. Argument variable






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






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






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






18. End header line.






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






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






21. prints its parameter to the console






22. Argument variable






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






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






25. Adds something to a variable






26. A statement that breaks out of a loop.






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






28. Less than or equal to symbol






29. turns an object into an integer






30. subtract AND assignment operator






31. A statement that ends the current iteration of a loop but continues looping.






32. exponentiation






33. Writes stuff to the file.






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






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






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






37. Command to print to the screen






38. divide AND assignment operator






39. A logical operator which returns a value of True if either of the conditions is true.






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






41. adds an item to a list






42. modulo






43. add AND assignment operator






44. absolute value






45. unction to read one line of a file






46. Less than symbol






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






48. adds an item to a list






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






50. Symbol to add things together