-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2 Working With Strings.py
More file actions
26 lines (22 loc) · 948 Bytes
/
2 Working With Strings.py
File metadata and controls
26 lines (22 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'''
STRINGS
"Strings are arrays of bytes representing Unicode characters"
Use single, double or triple quotes to show a string.
'''
#Variables in a python program gives data to the computer for processing
character_name = "Berry" #This is a string variable
character_age = "17.5678213" #no need quotation mark for number
is_Male = True #Boolean Variable
#EXAMPLE STORY 👇String 👇Variable 👇String
print("There once was a man named " + character_name + ", ") #This print statement has both strings and variables joined with concatenation operator (+)
print("He was " + character_age + " years old.")
#String Variable
character_name = "Tba"
character_age = "15"
print("He really liked the name " + character_name + ", ")
print("But didn't like being " + character_age + ".")
'''OUTPUT
There once was a man named Berry,He was 17.5678213 years old.
He really liked the name Tba,
But didn't like being 15.
'''