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. A logical operator which negates an expression so that it returns a value of True if the expression is false.






2. exponent AND assignment operator






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






4. Function to open or read a file






5. absolute value






6. square root






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






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






9. Function to write something to a file






10. Function to read the contents of a file






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






12. Greater than symbol






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






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






15. multiply AND assignment operator






16. Symbol to subtract things from each other






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






18. Greater than symbol






19. exponentiation






20. Create a variable.






21. writes stuff to the file






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






23. Symbol used to create comments






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






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






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






27. floor division AND assignment operator






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






29. unction to read one line of a file






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. adds an item to a list






32. Symbol used to create comments






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






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






35. This statement causes an exception.






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






37. divide AND assignment operator






38. add AND assignment operator






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






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






41. asks the user for a response and returns that response






42. The extension for Python scripts






43. Create a variable.






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






45. Function to read the contents of a file






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






47. turns an object into a string






48. Less than symbol






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






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