Computer Science, asked by sajib148525, 4 months ago

Write a program to find the greatest number among three numbers using a function named greatest_number?​

Answers

Answered by valeriy69
3

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

from random import randrange

def greatest_number(nums):

max_num = nums[0]

for n in nums:

if max_num < n:

max_num = n

return max_num

nums = [randrange(1, 69) for n in range(3)]

print(greatest_number(nums))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Anonymous
1

Answer:

from random import randrange

def greatest_number(nums):

max_num = nums[0]

for n in nums:

if max_num < n:

max_num = n

return max_num

nums = [randrange(1, 69) for n in range(3)]

print(greatest_number(nums))

Similar questions