1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vika [28.1K]
3 years ago
8

Write a program that asks for 'name' from the user and then asks for a number and stores the two in a dictionary (called 'the_di

ct') as key-value pair. The program then asks if the user wants to enter more data (More data (y/n)? ) and depending on user choice, either asks for another name-number pair or exits and stores the dictionary key, values in a list of tuples and prints the list. Note: Ignore the case where the name is already in the dictionary. Example: Name: pranshu Number: 517-244-2426 More data (y/n)? y Name: rich Number: 517-842-5425 More data (y/n)? y Name: alireza Number: 517-432-5224 More data (y/n)? n [('alireza', '517-432-5224'), ('pranshu', '517-244-2426'), ('rich', '517-842-5425')]
Computers and Technology
1 answer:
babymother [125]3 years ago
5 0

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'}

You might be interested in
How can touch typing increase productivity of a business?
Sladkaya [172]

Answer:

Increasing your typing speed will improve your productivity and save you time. Having a good typing speed will improve your job satisfaction.

Explanation:

hope his helps

3 0
2 years ago
Read 2 more answers
Assume you have a packet with data payload of 1024 bytes. The packet header is 6 bytes. Assume there is no other overhead. The c
Sveta_85 [38]

Answer:

PER= 0.824

Explanation:

Total bytes = 1024+6

=1030 bytes

=1030*8 bits

= 8240 bits

BER = 0.0001

Packet Level Error (PER) = 8240*0.0001

= 0.824

7 0
3 years ago
What is the difference between the Paste Special and Paste Link options?
kotegsom [21]
Paste Link lets you automatically update the referenced document.
8 0
3 years ago
Read 2 more answers
Discussion Question 10: A bank in California has 13 branches spread throughout northern California , each with its own minicompu
GuDViN [60]

Answer:

The system that will be more prone to attack or vulnerability is the  bank that has ten branches spread throughout California with the data being stored on a mainframe in San Francisco.

Explanation:

Solution

If the databases are not shared by all the branches throughout the network, they could not be hacked or accessed easily. but when the systems are in a network and share databases or resources,then these could be more vulnerable  to unauthorized persons or individuals.

The data been stored on a mainframe in San Francisco that is a centralized access by 10 branches of another bank. what this implies is that networking is involved or used to share data.

With this example, the chances of vulnerability or attacks increases from the following :

  • Accounts payable could be disturbed by changing cash in payment false.
  • Entering incorrect data into the system. such transactions can be altered, deleted by unauthorized persons.
  • Transaction fraud like hacking, masquerading are very common in a networked system.
3 0
3 years ago
Your database was damaged due to hardware failure. What can you use to restore it?
vesna_86 [32]
The only way is if you have backed up everything! Computers are amazing but they don't know that you need to back up your info. You should back up everything regularly! 
Hope this helped and have a nice day!

8 0
3 years ago
Other questions:
  • _________ involves encouraging employees to engage in behaviors directly related to goal accomplishment.
    6·1 answer
  • You are driving in the right lane of a municipal road the road has three lanes in your direction ahead of you in the lane to you
    14·2 answers
  • How to transfer photos from iphone to iphone?
    14·2 answers
  • If a piece of software designed to run on Windows XP can run on the latest version of Windows, we say the latest version of Wind
    14·1 answer
  • Jake was working on an essay for his English class on a stormy Sunday afternoon. Before he could save his document, a big strike
    8·1 answer
  • In discussing inventory, Helena mentions that bikinis for sale on the website are not always in stock. Say customer feedback ind
    15·1 answer
  • What does =SUM(B2:B6) mean
    6·1 answer
  • Define the term hardwar<br><br>​
    9·2 answers
  • _____is used to organize and modify the properties of the current selection.
    6·1 answer
  • question 1 scenario 1, question 1-5 you’ve just started a new job as a data analyst. you’re working for a midsized pharmacy chai
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!