Math, asked by liamj308, 1 year ago

Write a program that takes three numbers as input and prints the largest.

Sample run:

Enter a number: 20
Enter a number: 50
Enter a number: 5
Largest: 50
Hi can you all help me with this, its in python and im stuck on what the code is for it

Answers

Answered by YASH3100
9

Step-by-step explanation:

n = int(input("Enter the number of elements to be in the list:"))

b=[ ]

for i in range(0,n):

a=int(input("Element: "))

b.append(a)

c=[ ]

d=[ ]

for i in b:

if(i%2==0):

c.append(i)

else:

d.append(i)

c.sort()

d.sort()

count1=0

count2=0

for k in c:

count1=count1+1

for j in d:

count2=count2+1

print("Largest even number:",c[count1-1])

print("Largest odd number",d[count2-1])

HOPE IT HELPS YOU,

THANK YOU. ☺️

Answered by Anonymous
1

Answer:

Step-by-step explanation:

i in range(0,n):

a=int(input("Element: "))

b.append(a)

c=[ ]

d=[ ]

for i in b:

if(i%2==0):

c.append(i)

else:

d.append(i)

c.sort()

d.sort()

count1=0

count2=0

for k in c:

count1=count1+1

for j in d:

count2=count2+1

print("Largest even number:",c[count1-1])

print("Largest odd number",d[count2-1])


arik86: hlo
rohangupta214: Bag I contains 3 red and 4 black balls and Bag II contains 4 red and 5 black balls. 
One ball is transferred from Bag I to Bag II and then two balls are drawn at 
random (without replacement) from Bag II. The balls so drawn are found to be 
both red in colour. Find the probability that the transferred ball is red.  Please answer this.
Similar questions