Answer:
Okay. I am doing it with Python. Hope it'll help you to understand the concept.
Code:
the_dict={} #Creating a dictonary
def dat(): # Creating a function named dat()
name = input('Your Name: ') # Data from user
ph = input('Phone Number: ')
for i in range(1): #Creating loop
the_dict[name]=ph # Placing the value in dictonary
more = input('More Data (y/n): ') # Asking for More data
if more == 'y': # if more is y then run the function dat()
dat() # calling dat()
elif more == 'n': # if more is n then print the dictonary named 'the_dict'
print(the_dict)
else:
print('Wrong Input') # if wrong input print the message and run dat() again
dat()
dat() # calling the function
Result:
Your Name: PyMan
Phone Number: 9814579063
More Data (y/n): y
Your Name: PyMman2
Phone Number: 451513262026
More Data (y/n): y
Your Name: C#Man
Phone Number: 7798822222
More Data (y/n): n
{'PyMan': '9814579063', 'PyMman2': '451513262026', 'C#Man': '7798822222'}