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. Reads just one line of a text file.






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






3. Adds a new line character






4. Greater than or equal symbol.






5. exponentiation






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






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






8. absolute value






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






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






11. sets the file's current position






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






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






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






15. modulo






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






17. Command to print to the screen






18. A data type for representing numbers with fractional values.






19. Symbol used to create comments






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






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






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






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






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






25. Holds the value of something - e.g. oh_hi = 4 where oh_hi is the variable.






26. Binary XOR Operator copies the bit if it is set in one operand but not both. (a ^ b) will give 49 which is 0011 0001






27. turns an object into an integer






28. turns an object into a string






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






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






31. Less than symbol






32. Function to write something to a file






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






34. Greater than or equal symbol.






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






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






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






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






39. Adds something to a variable






40. empties the file






41. turns an object into an integer






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






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






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






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






46. assignment operator






47. writes stuff to the file






48. Symbol to multiply things






49. Prevents a runtime error from stopping the program.






50. Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true.