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.


    Simple program output

    Pythonista
    2
    3
    17
    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.
    • A
      AM1965 last edited by

      I’m a beginner to python I have a question regarding this program myName = (input())
      print(myName) can anyone tell me why the output to this program is the name I entered is displayed twice I can’t figure out why

      cvp 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @AM1965 last edited by cvp

        @AM1965 the input function sends your input to the console, that's your first line, the print function also sends your name to the console, that's your second line.

        Perhaps, could you try this

        import console
        myName = console.input_alert('enter your name')
        print(myName)
        
        A 1 Reply Last reply Reply Quote 0
        • A
          AM1965 @cvp last edited by

          @cvp oh ok thank you

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