Photo AI

A programmer has written a Python program that asks the user to input two integers and then output which of the two integers is the largest - AQA - GCSE Computer Science - Question 4 - 2021 - Paper 1

Question icon

Question 4

A-programmer-has-written-a-Python-program-that-asks-the-user-to-input-two-integers-and-then-output-which-of-the-two-integers-is-the-largest-AQA-GCSE Computer Science-Question 4-2021-Paper 1.png

A programmer has written a Python program that asks the user to input two integers and then output which of the two integers is the largest. Complete the program be... show full transcript

Worked Solution & Example Answer:A programmer has written a Python program that asks the user to input two integers and then output which of the two integers is the largest - AQA - GCSE Computer Science - Question 4 - 2021 - Paper 1

Step 1

num2 = ____________ (input("Enter a second number: "))

96%

114 rated

Answer

num2 = int(input("Enter a second number: "))

Step 2

if num1 > num2:

99%

104 rated

Answer

print("num1 is bigger.")

Step 3

elif num1 ____________ num2:

96%

101 rated

Answer

elif num1 < num2:

Step 4

print(" ____________ is bigger.")

98%

120 rated

Answer

print("num2 is bigger.")

Step 5

__________

97%

117 rated

Answer

else:

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;