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. Less than or equal to symbol






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






3. floor division






4. assignment operator






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






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






7. Empties the file - watch out if you care about the file.






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






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






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






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






12. Adds a new line character






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






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






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






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






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






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






19. Symbol to multiply things






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






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






22. This statement causes an exception.






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






24. A built-in function that converts its argument to a string.






25. empties the file






26. Symbol used to create comments






27. turns an object into an integer






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






29. Command to print to the screen






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






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






32. Adds something to a variable






33. Symbol used to create comments






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






35. square root






36. Function to open or read a file






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






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






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






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






41. modulo






42. turns an object into a string






43. floor division AND assignment operator






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






45. Argument variable






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






47. modulus AND assignment operator






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






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






50. adds an item to a list