-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring.py
23 lines (22 loc) · 1.02 KB
/
string.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
name = "jirattanun"; #name is string we can use " " to tell compiler that in " " is string
nickname = 'Tien'; #we can use ' ' to
intro = "I'm student";
intro2 = "My name is \"Tien\""; #if you want to put" or ' in string use \ before it
my_number = 'One '\
'Two '\
'Three ' #if you need to connet the string in another lin use\ to connect
table = """\
variable
1. name jirattanun
2. nickname Tien
3. intro I'm student
4. intro2 My name is "Tien"
"""; #use """\ """ you can custom your string
print(table);
print(name);
print(nickname);
print(intro);
print(intro2);
print(my_number);
print(nickname[1]); #you can chose location in the string that you want to print.Start with [0]
print(len(nickname)); #you can use len() to count the alphabet in string