It is currently 27 Feb 2021, 11:48

• 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

Strings in Python

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

Strings in Python

Post#1 by tim » 29 Sep 2018, 02:36


What is a string?
A string is a series of letters/characters.
In Python strings are declared inside double quotes (") or single quotes (').
So for example the following are strings:
"This is a string"
'so is this'

I am going to introduce you to a very first function in Python named print(). In Python, functions are called by typing the name of function followed by brackets (parenthesis), with inputs (parameters) passed in between the brackets. The print() function prints out whatever values you pass in as input.

For example if you wanted print out "Hello there!". You'd type the following code:
print ("Hello there!")

You can try out play with what you've learned so far here (Click the Run button to run the code, you'll see output on the right).

Try playing with different/your own strings to see how it works.

Next lesson: Variables 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