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. multiply AND assignment operator






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






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






4. Writes stuff to the file.






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






6. This statement causes an exception.






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






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






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






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






11. A keyword that does nothing but fill space to indicate code which will be written later.






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






13. subtract AND assignment operator






14. Less than symbol






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






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






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






18. modulo






19. Function to read the contents of a file






20. add AND assignment operator






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






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






23. Create a variable.






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






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






26. square root






27. ,multi-line comment hard-code,Fix (data or parameters) in a program in such a way that they cannot easily be altered by the user.






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






29. turns an object into an integer






30. modulo






31. Greater than symbol






32. Function to open or read a file






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






34. Greater than or equal symbol.






35. Prevents a runtime error from stopping the program.






36. exponent AND assignment operator






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






38. single line comment






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






40. End header line.






41. assignment operator






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






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






44. turns an object into a string






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






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






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






48. Adds something to a variable






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






50. Symbol to add things together