Most popular tags

302 questions

410 answers

70 comments

310 users

Most active Members
this week:

    Recent Badges

    Popular Question
    - 14nicholsonc -

    how to use a decimal in an input

    +6 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 14goldinga (710 points)
    edited Oct 6, 2016 by 14goldinga

    1 Answer

    +8 votes
     
    Best answer

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

    answered Oct 6, 2016 by 14hutchinsona (800 points)
    selected Oct 6, 2016 by 14goldinga
    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.
    ...