- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring2.py
More file actions
Latest commit
21 lines (18 loc) · 505 Bytes
/
Copy pathstring2.py
File metadata and controls
21 lines (18 loc) · 505 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# string template
name="Bony"
age=23
template_string="I am {}. I am {} years old.".format(name,age)
print(template_string)
# or
template_string1="I am {fname}. I am {user_age} years old.".format(fname='Amin',user_age=22)
print(template_string1)
# f string
string=f"I am {name}. I am {age} years old"
print(string)
#string concatenation
a="Hello"
b=" World"
c=a+" "+b
print(c)
print("hello "*3) # pi world ta 3 bar gun akare ashbe ba jodi kono
# value hoto tahole ie, 2*2*2 = 8