Ask Question
7 July, 17:44

Add a selection statement that will determine which number is larger, or if there is a tie. The best way to do this is to create a nested if else where you first check to see if p1number is equal to p2number

+2
Answers (1)
  1. 7 July, 17:59
    0
    p1number = 4 p2number = 7 if (p1number! = p2number) : if (p1number > p2number) : print ("p1number is bigger than p2number") else: print ("p2number is bigger than p1number") else: print ("There is a tie")

    Explanation:

    The solution is written in Python 3.

    Firstly, create two variables p1number and p2number (Line 1-2). Assign a random number to the variables, respectively (e. g. 4 and 7).

    Create a if statement to check if p1number not equal to p2number (Line 4). If so, proceed to check if p1number bigger than p2number (Line 5). If true, print the message "p1number is bigger than p2number" or vice versa.

    If p1number equal to p2number, print the message "There is a tie" (Line 10).
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Add a selection statement that will determine which number is larger, or if there is a tie. The best way to do this is to create a nested ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers