Write a program to find the greatest number among three numbers using a function named greatest_number?
Answers
Answered by
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))
Answered by
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
Math,
2 months ago
Social Sciences,
2 months ago
English,
4 months ago
English,
4 months ago
Computer Science,
10 months ago
Math,
10 months ago
Accountancy,
10 months ago