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
Explain why this scenario could put an organization in jeopardy of losing some of its workforce.
Ksenya-84 [330]

Answer:

Not educating its employees on the new software.

8 0
3 years ago
Which statement reflects an opinion about technology? Select all that apply. Select one or more: a. It is easy to imagine that a
True [87]

Answer:

All options apply to the question because each one reflects one side of technology in relation to the artist's case (that could be a software engineer or a even a hardware designer).

Explanation:

Letter a applies to the question in terms of computer program's behavior with no people's assistance, which is something not real for the present time, although it is easy to imagine that it is going to be a reality in a near future for all the improvements engineers and developers have made. Letter b also applies because computers and softwares have become one of the most important tools for artists around the world, whether for researching and/or for sharing and/or selling their productions, however it is a radical idea to think an artist is not necessary anymore, that is similiar to say human beings are not necessary only because machines have improved. Letter c also applies to the question for all improvements made in art and art forms after all improvements made in technology and tools for technologies development. And, letter d also applies because computers may be used for studying and/or working, which is the perfect tool for a workplace, and this is why it has become essential in many organizations, companies, subsidiaries, agencies, schools, and more.

3 0
3 years ago
Determine whether or not the following pairs of predicates are unifiable. If they are, give the most-general unifier and show th
Evgen [1.6K]

Answer:

a) P(B,A,B), P(x,y,z)

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }.

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q.

c. Older(Father(y),y), Older(Father(x),John)

Thus , mgu ={ y/x , x/John }.

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B.

e) P(f(x), x, g(x)), P(f(y), A, z)    

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

Explanation:  

Unification: Any substitution that makes two expressions equal is called a unifier.  

a) P(B,A,B), P(x,y,z)  

Use { x/B}  

=> P(B,A,B) , P(B,y,z)  

Now use {y/A}  

=> P(B,A,B) , P(B,A,z)  

Now, use {z/B}  

=> P(B,A,B) , P(B,A,B}  

Hence, most general unifier = {x/B , y/A , z/B }  

b. P(x,x), Q(A,A)  

No mgu exists for this expression as any substitution will not make P(x,x), Q(A, A) equal as one function is of P and the other is of Q  

c. Older(Father(y),y), Older(Father(x),John)  

Use {y/x}  

=> Older(Father(x),x), Older(Father(x),John)  

Now use { x/John }  

=> Older(Father(John), John), Older(Father(John), John)  

Thus , mgu ={ y/x , x/John }  

d) Q(G(y,z),G(z,y)), Q(G(x,x),G(A,B))  

Use { y/x }  

=> Q(G(x,z),G(z,x)), Q(G(x,x),G(A,B))

Use {z/x}  

=> Q(G(x,x),G(x,x)), Q(G(x,x),G(A,B))  

This is not unifiable as x cannot be bound for both A and B  

e) P(f(x), x, g(x)), P(f(y), A, z)  

Use {x/y}  

=> P(f(y), y, g(y)), P(f(y), A, z)  

Now use {z/g(y)}  

P(f(y), y, g(y)), P(f(y), A, g(y))  

Now use {y/A}  

=> P(f(A), A, g(A)), P(f(A), A, g(A))  

Thus , mgu = {x/y, z/y , y/A }.

7 0
3 years ago
What special signal is issued periodically from an Access Point and contains the network transmission rate and service set ident
olya-2409 [2.1K]

Answer:

beacon frame  

Explanation:

Beacon frame is a management frame In computer networks, known to be in IEEE 802.11 based WLANs. These frames are transmitted periodically and they contain all the  information a station will require before it can rightly transmit a frame.  

When it comes to announcing the presence of devices in a wireless computer network (WLAN), Beacon frames are used, and they can also be used in the synchronization of the devices and services

6 0
2 years ago
Explain briefly why the discovery phase is a favorite with many developers
Mamont248 [21]

Answer:

Discovery phase is the beginning step of a system development work. It is an important step for our professional staff, as people will need the information gathered to make informed technical advice for the construction effort and to provide an exact cost assessment.

Explanation:

Discovery regulates our organization with the customer’s requirements at the origin. The exercises and deliverables of outline Discovery are essential to the correctness of design evaluation and preparation, and we suggest that they always are completed for complicated custom requests with unknown and unsteady technical elements.

3 0
3 years ago
Other questions:
  • Which is faster, a hi-speed usb port or a superspeed usb port?
    15·2 answers
  • What protocol suite below is the most commonly used protocol for local area network (lan) communication?
    8·1 answer
  • In the structure of a conventional processor, what is the purpose of the data path?
    15·1 answer
  • How do you change exposure to allow for greater DoF
    10·1 answer
  • Which principle of animation deals with imparting a unique identity to the animated character?
    5·1 answer
  • Darcy was working on a presentation on playing chess. Because she chose the Checkerboard animation for her slide title, she had
    15·2 answers
  • when inserting a bibliography one choose from multiple ______ of bibliographies.[insert Bibliography]
    12·1 answer
  • How do people decide their ethical behavior
    13·2 answers
  • What is the meaning of FTTH
    9·2 answers
  • In what way, if any, are problems related to conflicts? Problems and conflicts are the same thing. Problems and conflicts are th
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!