-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathips6.py
More file actions
42 lines (33 loc) · 955 Bytes
/
ips6.py
File metadata and controls
42 lines (33 loc) · 955 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
33
34
35
36
37
38
39
40
41
42
# x = input()
# y = x[0:4]
# count_upper = 0
# for i in list(y):
# if i.isupper():
# count_upper += 1
# if count_upper >= 2 :
# print(x.upper())
# else:
# print(x)
# x = input().split(",")
# x.sort()
# print(x)
"""
Write a Python program to find the first appearance of the substring 'Yes' and 'Good' from a given string, if 'Yes' follows the 'Good', replace the whole 'yes'...'Good' substring with 'better'. Return the resulting string.
Sample String : 'Yes the description looks Good!'
'The description looks Good!'
Expected Result : 'The lyrics is good!'
'The lyrics is better!'
Input: Get the input string, s, entered by user
Output:Display the result string s1
"""
s = input()
s = s.lower()
if "yes" in s and "good" in s:
s = s.split()
if s.index("yes") < s.index("good"):
s.remove("yes")
print(" ".join(s))
else:
pass
elif "good" in s :
print(s.replace("good","better"))