It is currently 27 Feb 2021, 11: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

User Inputs in Python

Simple lessons to get your started in Python language
tim
GL Blogger

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

         


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 1 guest