+ 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

16th Jan 2022, 12:13 PM
Ihussss
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.
16th Jan 2022, 12:44 PM
Simba
Simba - avatar
+ 1
Thanks everyone for your replies and Simba thanks i tried your method and it worked :)
18th Jan 2022, 4:21 PM
Ihussss
0
Hi can you explain more i can't understand it
16th Jan 2022, 12:41 PM
Mohamed Raaid
Mohamed Raaid - avatar
0
Where is your code ? Basicly, you can use if elif else to judge
16th Jan 2022, 12:41 PM
FanYu
FanYu - avatar