Generate a random number between 1 and 100. That will be the number that the user should guess. Please print the random number. Generate a random number by using the random.randint function Try several times to check that the number produced is random.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.7: Do While Loops
Problem 3E: (Misc. application) a. Write a program to reverse the digits of a positive integer number. For...
icon
Related questions
icon
Concept explainers
Question

In Python lang.

ONE

  1. Generate a random number between 1 and 100. That will be the number that the user should guess. Please print the random number.
  2. Generate a random number by using the random.randint function
  3. Try several times to check that the number produced is random.

TWO: 0010

  1. Create a variable and ask the user to input a number.
  2. Ask the user to input a number in a variable that will be rewritten every time the user inserts a number and

Enforce the rules:

  1. Enforce that the input is a digit from 1 to 100.
  2. Give feedback to the user if the number needs to meet the rule.
  3. Allow the user to input the number again.

If the number meets the rules, convert the input [a string] into an integer and evaluate if the guessed number is the same as the randomly generated number

FOUR:

Evaluate if the randomly generated number is the same that the number input by the user. 

FIVE:

  1. Use the dictionaries that you created for faculty members.
  2. Be sure that all the dictionaries have the same keys: name, last name, etc.
  3. If there are keys or values missing, add them. If you do not have the value, you can use 'n/a' or 'TBD'.
  4. Make a list of the dictionaries.
  5. Loop the list to print all the information available to each faculty member.

SIX:

Make a dictionary with the US states and their capitals (listed at the end of this file). The keys will be the states, the capitals will be the values. i.e. 'New York'  : 'Albany'

  1. Use a loop to print 50 messages, one for each of the 50 states, that say:

‘Albany city is the capital of New York state.'

  1. Use a loop to print the 50 names of the states adding at the end the word state and a dot. Use end=.
  2. Use a loop to print the 50 capitals and add at the end the word city and a dot.
  3. Slow back the process by 2 seconds by using the time method.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning