-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpro3.py
More file actions
27 lines (22 loc) · 849 Bytes
/
Copy pathpro3.py
File metadata and controls
27 lines (22 loc) · 849 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
27
"""Strings are immutable which means Strings are stored in memory as fixed sequences of characters.
Any operation that seems to modify a string actually creates a new string object.
The original string remains unchanged."""
# 1>print input name and good afternooning
name=str(input("Enter your name:"))
print (name,"Good Afternoon")
# 2>printe name and date in string
letter='''<name>
you are selected
<date>
'''
letter=letter.replace("<name>","nikhil")
letter=letter.replace("<date>","02-06-26")
print(letter)
# 3> refarce the following secentences with escape function
letter=print("Dear harry,\n\tThis python course is nice.\n\t\tThanks!")
# 4>find double space in program
a="today is sunday & i love funday"
print(a.find(" "))
# 5>replace double space with triple space
a="today is sunday & i love funday"
print(a.replace(" "," "))