BeginnersTutorial:Tutorial/Lesson 2

From jWork.ORG
Revision as of 16:54, 11 December 2016 by Jworkorg (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Lesson 2: Working with text

A variable can not only keep numbers, but it can also stand for also other complicated "objects", such as text, images, and large collections of numbers.

Let us show that we can keep a text:

text="This is my first text"

Now the variable "text" keeps your sentence. In fact, this variable can keep an entire novel! How you can check that the variable contains something? As usual, print it:

text="This is my first text"
print text

You can add pieces of text together to make a longer text:

t1="This is my text."
t2="This is another text."
print text

This will print the sentence:

This is my text. This is another text.