Skip to content

Commit b733595

Browse files
committed
added 4 new files
1 parent 69ed5c0 commit b733595

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

nineteen.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
input_string = input('enter a string : ')
2+
frequency = {}
3+
for i in input_string:
4+
if i in frequency:
5+
frequency[i] += 1
6+
else:
7+
frequency[i] = 1
8+
print(frequency)
9+
10+

nineteenone.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
input_string = input('enter a string : ')
2+
string_ = input_string.lower()
3+
frequency = {}
4+
for i in string_:
5+
if i in frequency:
6+
frequency[i] += 1
7+
else:
8+
frequency[i] = 1
9+
print(frequency)
10+
11+

nineteenthree.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
map_={}
2+
while True:
3+
list_=input("enter command : ")
4+
cond=list_.split()
5+
if cond[0]=='stop':
6+
break
7+
8+
else :
9+
if cond[0] in map_ :
10+
print ("in if")
11+
map_[cond[0]].add(cond[1])
12+
else:
13+
print("in else")
14+
map_[cond[0]]={cond[1]}
15+
print(map_)

nineteentwo.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
lst = []
2+
while True :
3+
commands = input()
4+
commands = commands.split()
5+
if commands[0] == 'stop':
6+
break
7+
elif commands[0] == 'push':
8+
lst.append(commands[1])
9+
elif commands[0] == 'pop':
10+
index_of_value = lst.index(commands[1])
11+
lst.pop(index_of_value)
12+
else:
13+
print('invalid command')
14+
15+
print(lst)

0 commit comments

Comments
 (0)