Skip to content

Commit 7d50b4c

Browse files
authored
Update Day_11.md
1 parent 62cf329 commit 7d50b4c

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

Status/Day_11.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ print(lst2)
5656
### Hints: Use "for" to iterate the tuple. Use tuple() to generate a tuple from a list.
5757

5858
-------------------
59-
**My Solution: Python 3**
59+
60+
**Main Author's Solution: Python 2**
6061
```
6162
tp = (1,2,3,4,5,6,7,8,9,10)
6263
li = list()
@@ -82,3 +83,33 @@ tpl1 = tuple(filter(lambda x : x%2==0,tpl)) # Lambda function returns True if f
8283
print(tpl1)
8384
```
8485
----------------
86+
87+
# Question 40
88+
### Level 1
89+
90+
**Question:**
91+
92+
***Write a program which accepts a string as input to print "Yes" if the string is "yes" or "YES" or "Yes", otherwise print "No". ***
93+
94+
----------------------
95+
### Hints: Use if statement to judge condition.
96+
97+
-------------------
98+
**Main Author's Solution: Python 2**
99+
```
100+
s= raw_input()
101+
if s=="yes" or s=="YES" or s=="Yes":
102+
print "Yes"
103+
else:
104+
print "No"
105+
```
106+
----------------
107+
**My Solution: Python 3**
108+
```
109+
s = input()
110+
if s.lower() == 'yes': # lower function returns all lowercase letters in the string
111+
print('Yes')
112+
else:
113+
print("No")
114+
```
115+
----------------

0 commit comments

Comments
 (0)