omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    How do you divide in python

    Pythonista
    3
    3
    1803
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bryan.cheng04
      bryan.cheng04 last edited by

      How do you divide in Pythonista?```
      print ("hi")

      option = raw_input("Enter a input for meter: ")

      feet = option / 0.3048

      print (feet)

      1 Reply Last reply Reply Quote 0
      • ellie_ff1493
        ellie_ff1493 last edited by ellie_ff1493

        its just input and you need an number instead of a str

        print("hi")
        
        option = input("Enter a input for meter: ")
        
        feet = float(option) / 0.3048
        
        print(feet)
        
        1 Reply Last reply Reply Quote 0
        • dgelessus
          dgelessus last edited by

          Note: in Python 3 you need to use input, but in Python 2 you need to use raw_input to do the same thing. (Python 2 also has an input function, but that does something different.)

          If you're a beginner, I would stronly recommend using Python 3 and not Python 2. Python 3 the current version of the language, has some nice new features, and has less strange/confusing behavior than Python 2 in some places.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors