+ 1
I need help with writing a python list
I need to create a list but donāt understand how. A dog temperature is between 38.3 and 39.2 Celsius. If it was measured again it would show different readings like: 39.3, 38.1, 38.5, 38.4, 39.1, 38.9, 39.2, 38.6, 38.0 I would need a new list for those temperatures which a) temperature is lower than 38.3 so it would be called L b) temperature is normal and add N to the list and c) where temperature is higher add H. The list would give: H,L,N,N,N,N,H,N,N,L. Iām really confused and need help. Thank you
4 Answers
+ 3
1. You can store all readings in a list and create another list as empty list.
2. You may try using a if-else statement inside a for loop to check each temperature whether it's lower than 38.3 or higher.
3. If temperature is lower add L to the empty list using append() and H vice versa.
+ 1
Thanks everyone for your replies and Simba thanks i tried your method and it worked :)
0
Hi can you explain more i can't understand it
0
Where is your code ?
Basicly, you can use if elif else to judge