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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education