-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringsMethods.py
More file actions
33 lines (26 loc) · 891 Bytes
/
Copy pathstringsMethods.py
File metadata and controls
33 lines (26 loc) · 891 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
28
29
30
31
32
# name = "Hasnain"
# print(len(name))
# print(name.endswith("in"))
# print(name.startswith("Has"))
# print(name.upper())
# index = name.find("a")
# print(index)
# replaceName = name.replace("nain", "eeb")
# print(replaceName)
# splitName = name.split("s")
# print(splitName)
# string = "'Hello \n world' \r"
# print(string.strip()) # removes leading and trailing whitespace characters
# import datetime
# # name = input("Enter your name: ")
# date = datetime.date.today()
# # print(f"Dear {name}, \n You are selected for an interview {date} \n ")
# letters = """dear | Name |
# you are selected | Date |"""
# replacedLetters = letters.replace("| Name |", "Hasnain").replace("| Date |", "22/22/22")
# uppercaseLetters = replacedLetters.upper()
# print(uppercaseLetters)
# print(letters.find(" "))
# a = "hello"
# a[0] = "P"
# print(a) # strings are immutable in python