Instruction:-
#1. What will be the output of the following Python code?
x = 5
y = 10
x, y = y, x
print(x, y)
#2. What is the purpose of the following code?
for i in range(1, 6):
print(i * “*”)
#3. Which data type is returned by the input() function in Python?
#4. What is the value of x after the following code runs?
x = 4
x = x + 3 * 2
#5. What does the following code do?
def is_even(n):
return n % 2 == 0
#6. In a flowchart, what symbol is used to represent a decision or condition?
#7. Which symbol in a flowchart represents an input or output operation?
#8. A flowchart has a process box with x = x + 1. What does this do?
#9. What is the correct flowchart symbol for a process or calculation?
#10. A flowchart terminator symbol usually has what shape?
#11. What does a parallelogram in a flowchart represent?
#12. Which of the following is used to represent a loop in a flowchart?
#13. Which flowchart symbol should be used to show the start or end of a program?
#14. In a flowchart, how many output paths are possible from a decision (diamond) symbol?
#15. What is the purpose of arrows in a flowchart?
#16. Which flowchart symbol would you use to represent the instruction total = total + number?
#17. In a flowchart, which symbol should be used when asking “Is number > 0?”
#18. Which direction does the flow usually move in a flowchart?
#19. What would be the most appropriate symbol to use when displaying a message to the user?
#20. Which of these is NOT a valid flowchart rule?
#21. Which of the following best describes an algorithm?
#22. Which keyword is used in Python to create a function?
#23. What is the output of the following Python code?x =
0
while x < 3:
print(x)
x += 1
#24. What is the term for a repeating section of code in an algorithm?
#25. What is the term for a repeating section of code in an algorithm?
Previous
Finish