Skip to content

Commit a73d208

Browse files
Shashankjain12MadhavBahl
authored andcommitted
Day 4 coding (#48)
* Add @Shashankjain12 as a contributor * contribution commit * Day1 and Day2 * Update README.md * Day 3 updated * Update README.md * Update README.md * Update README.md * Update README.md * Day 4
1 parent 3c7211c commit a73d208

File tree

5 files changed

+75
-3
lines changed

5 files changed

+75
-3
lines changed

Day2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,6 @@ if d==e:
662662
else:
663663
print("Not a pallindrome")
664664
```
665-
666665
## Ruby implementation
667666

668667
### [palindrome.rb](./Ruby/palindrome.rb)
@@ -680,3 +679,4 @@ end
680679
```
681680

682681

682+

Day3/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ else:
289289
* @author: Shashank Jain
290290
* @date: 24/12/2018
291291
"""
292-
292+
### [Solution](./Python/Shashankham.py)
293+
``` Python
294+
"""
295+
* @author: Shashank Jain
296+
* @date: 24/12/2018
297+
"""
293298
a=input("Enter the first string?")
294299
b=input("Enter the second string?")
295300
c=list(a.replace(" ",""))

day4/Python/Shashankchar.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
* @author: Shashank Jain
3+
* @date: 25/12/2018
4+
"""
5+
a=input("Enter the string to count frequent occuring characters?")
6+
b=list(a.replace(" ","").lower())
7+
c=[]
8+
for i in b:
9+
d=(i,b.count(i))
10+
c.append(d)
11+
12+
e=dict(list(set(c)))
13+
f=max(e)
14+
g=max(e.values())
15+
print("maximum occurence is of {0}:{1}".format(f,g))
16+

day4/Python/Shashankvowel.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
* @author: Shashank Jain
3+
* @date: 25/12/2018
4+
"""
5+
a=input("Enter the string to count no. of vowels?")
6+
b=list(a.replace(" ","").lower())
7+
c=['a','e','i','o','u']
8+
count=0
9+
for i in b:
10+
for j in c:
11+
if (j==i):
12+
count=count+1
13+
print(count)
14+

day4/README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,26 @@ for char in string:
287287
print("Number of vowels in the string are : ",count)
288288

289289
```
290-
<hr/>
290+
##Python Implementation
291291

292+
##[Solution](./Python/Shashankvowels.py)
293+
"""
294+
* @author: Shashank Jain
295+
* @date: 25/12/2018
296+
"""
297+
```Python
298+
a=input("Enter the string to count no. of vowels?")
299+
b=list(a.replace(" ","").lower())
300+
c=['a','e','i','o','u']
301+
count=0
302+
for i in b:
303+
for j in c:
304+
if (j==i):
305+
count=count+1
306+
print(count)
307+
```
308+
309+
</hr>
292310
## Part B -- Max Chars Problem
293311

294312
**Question** - Given a string, write a program to return the character that appears most frequently in that string
@@ -438,4 +456,23 @@ print("The most occouring character in the string is : ", max(characters,key=cha
438456

439457
```
440458

459+
##Python Implementation
460+
###[Solution] (./Python/Shashankchar.py)
461+
"""
462+
* @author: Shashank Jain
463+
* @date: 25/12/2018
464+
"""
465+
``` Python
466+
a=input("Enter the string to count frequent occuring characters?")
467+
b=list(a.replace(" ","").lower())
468+
c=[]
469+
for i in b:
470+
d=(i,b.count(i))
471+
c.append(d)
472+
473+
e=dict(list(set(c)))
474+
f=max(e)
475+
g=max(e.values())
476+
print("maximum occurence is of {0}:{1}".format(f,g))
477+
```
441478

0 commit comments

Comments
 (0)