Skip to content

Commit

Permalink
added 4 new files
Browse files Browse the repository at this point in the history
  • Loading branch information
26rudra committed Jul 19, 2022
1 parent 69ed5c0 commit b733595
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nineteen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
input_string = input('enter a string : ')
frequency = {}
for i in input_string:
if i in frequency:
frequency[i] += 1
else:
frequency[i] = 1
print(frequency)


11 changes: 11 additions & 0 deletions nineteenone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
input_string = input('enter a string : ')
string_ = input_string.lower()
frequency = {}
for i in string_:
if i in frequency:
frequency[i] += 1
else:
frequency[i] = 1
print(frequency)


15 changes: 15 additions & 0 deletions nineteenthree.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
map_={}
while True:
list_=input("enter command : ")
cond=list_.split()
if cond[0]=='stop':
break

else :
if cond[0] in map_ :
print ("in if")
map_[cond[0]].add(cond[1])
else:
print("in else")
map_[cond[0]]={cond[1]}
print(map_)
15 changes: 15 additions & 0 deletions nineteentwo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
lst = []
while True :
commands = input()
commands = commands.split()
if commands[0] == 'stop':
break
elif commands[0] == 'push':
lst.append(commands[1])
elif commands[0] == 'pop':
index_of_value = lst.index(commands[1])
lst.pop(index_of_value)
else:
print('invalid command')

print(lst)

0 comments on commit b733595

Please sign in to comment.