How to Input Value in Python

Sometimes in a program, you need to prompt the user to enter a value so that your program can do something with that value. In Python, you use the "raw_input" command to input values. The end-user will see a prompt where she can enter the value.

Instructions

    • 1

      Open your Python program's script.

    • 2

      Type:

      example=raw_input('what the prompt says:')

      Replace "example" with the name you want to give the value. Replace "what the prompt says" with what you want to use to prompt the user.

    • 3

      Save your program.

Related Searches:

References

Comments

Related Ads

Featured