It is currently 26 Oct 2021, 17:50

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  🡆 Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP
Sponsored content for World Food Program

User Inputs in Python

Simple lessons to get your started in Python language
tim
GL Blogger
1st Place
5569 Post(s)

User Inputs in Python

Post#1 by tim » 14 Nov 2018, 14:51


To get user inputs in Python, we can use input function.

The syntax is input(PROMPT_MESSAGE).

To put get user to input their name for example we can use
name = input("Enter your name:")

This above code will prompt the user for a name and return that name as a string to assign to the variable name.

Play with what you've learned here.

Previous lesson: Functions/Methods in Python
aka Tin
World Food Program | Good Deeds Forum

         


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  🡆 Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests