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 built-in function that takes any value and converts it to an integer if possible - or complains otherwise.






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






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






4. This variable holds the arguments you pass to your Python script when you run it. Then you unpack it in your script so you have variables you can work with.






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






6. Less than symbol






7. End header line.






8. Adds something to a variable






9. modulo






10. Argument variable






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






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






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






14. absolute value






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






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






17. adds an item to a list






18. Symbol to subtract things from each other






19. turns an object into a string






20. Less than symbol






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






22. The extension for Python scripts






23. Command to print to the screen






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






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






26. unction to read one line of a file






27. single line comment






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






29. modulo






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






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






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






33. Greater than or equal symbol.






34. writes stuff to the file






35. Command to print to the screen






36. This statement causes an exception.






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






38. prints its parameter to the console






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






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






41. turns an object into a string






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






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






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






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






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






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






48. A statement that breaks out of a loop.






49. exponentiation






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







Sorry!:) No result found.

Can you answer 50 questions in 15 minutes?


Let me suggest you:



Major Subjects



Tests & Exams


AP
CLEP
DSST
GRE
SAT
GMAT

Most popular tests