Write a program that creates an array called temperatures and then add five temperatures input from the keyboard.
Print the array.
Sample Run:
Enter a temperature: 45
Enter a temperature: 67
Enter a temperature: 89
Enter a temperature: 47
Enter a temperature: 89
[45, 67, 89, 47, 89]
1
Expert's answer
2019-11-15T10:43:43-0500
temperatures = []
i = 0
while i < 5:
try:
t = int(input('Enter a temperature: '))
temperatures.append(t)
i += 1
except ValueError:
print('Enter a number')
print(temperatures)
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment