-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathday8.py
More file actions
25 lines (25 loc) · 911 Bytes
/
day8.py
File metadata and controls
25 lines (25 loc) · 911 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
#week2 ____ dsy8
# السلاسل النصية # لحذف المسافات في بداية ونهايةالسلاسل النصية نستخدم الدالة strip()
a=" hello word! "
print (a.strip())
#####################################
# to learn the length of string we can use len() function
a =" hello word! "
print (len(a))
####################################
#to print the string in lower case we are use lower()
##############################################
#to print the string in lower case we are use lower()
b =" muteb alotaibi "
print(b.strip())
print(b.upper())
print(b.lower())
print(b.title())
########################################
#to replace string we are use the function replace()
s = " welcom in saudi arabia "
print(s.replace("in","to"))
##########################################
#to split and devidied a strings we can use split()
w="hello , world!"
print(w.split(","))