Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #november 2015 pre-release paper 2 GCSE
- #tasks 1, 2 & 3
- from array import *
- badcount = 0
- array1 = array('f', []) #defines the array
- while True:
- user = float(input("Enter baby's temperature..."))
- if user < 36:
- print("Baby too cold!")
- badcount = badcount +1
- elif user > 37.5:
- print("Baby too hot!")
- badcount = badcount +1
- array1.append(user)
- x = min(array1)
- print("Min Temp is",(x))
- y = max(array1)
- print("Max Temp is",(y))
- z = y - x
- print("Temp difference is", (z))
- if badcount > 2 or z > 1:
- print("Baby outside safe zone!")
- print("----Temperature History----")
- for f in array1:
- print (f) #prints array
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement