Most popular tags

304 questions

415 answers

71 comments

329 users

Most active Members
this week:

    how to use a decimal in an input

    +4 votes
    distance1=int(input("How far do you live from SHS in KM?"))

     

    this doesnt allow me to use decimals (because of the int) but what is the correct code??
    asked Sep 30, 2016 in Python by anonymous
    edited Oct 6, 2016

    1 Answer

    +4 votes
     
    Best answer

    Use the float() function rather than int() function.

    answered Oct 6, 2016 by anonymous
    selected Oct 6, 2016
    NOICE ANSWER
    !Noice Reply!
    well done guys:)
    thanks aidan
    we did it reddit!
    Welcome to Selby Computing Q&A, where you can ask questions and receive answers from other students in Computer Science.
    ...