#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    8
    Rep Power
    0

    Minor issue needing help please


    Hi,

    This code works fine, however i think i need to import something because when i input a whole number it works fine,

    However when entering a number with a decimal it does not like it.

    any ideas what i am missing please?

    Code:
    def main():
        
        print 'Please check the temprature of the vat substance'
        print
        temprature=int(raw_input('Enter the tepmrature of vat substance in degrees Celcuis\n'
                                 '>>>'))
    
        if temprature<=102.5:
            print 'Tempreture Prefect'
            print
            print 'Return to check again in 15 minutes'
        if temprature>=102.6:
            print 'Temprature is to high!!'
            print
            print 'Please lower thermostat'
            print
            print 'Wait 5 minutes, and check again'
        restart=input('To restart programme type "1 and press Enter" to exit type "2 and press Enter"\n'
                        '>>>')
        if restart==1:
            main()
        if restart==2:
            exit()
            
    main()
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    8
    Rep Power
    0
    Sorted it myself should have been:

    float(raw_input

    not
    int(raw_input

    Thanks

IMN logo majestic logo threadwatch logo seochat tools logo