Ask Question
3 May, 13:13

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

+1
Answers (1)
  1. 3 May, 15:36
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers