
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
solve in python
Write a function randomNumber which will return a single random integer from 0 to 9, inclusive. It does not accept any parameters.
Write a function randomLetter which will return a random (lowercase) letter of the English alphabet (hint: if you still have you code from the last quiz, you can copy some of it to use here). It does not accept any parameters.
Write a function generatePassword that will create and return an alphanumeric password.
- It should accept one parameter: an integer nn
- The function should then randomly generate nn characters, assemble them into a string, and return that string
- Each character should have a 50% chance of being a letter and a 50% chance of being a number, and should be generated by calling one of the functions you defined earlier.
- If it is a letter, it should have a 50% chance of being uppercase and a 50% chance of being lowercase
Hints:
- randomNumber and randomLetter should be one or at most two lines long, not counting the definition
- generatePassword should be around 10 lines long
Sample Output
Here is a possible result of calling print(generatePassword(10))
pVA7XP8AT9
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps with 4 images

Knowledge Booster
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
- Write a full program that display the area of a rectangle. The program calls the following two functions: • getLengthWidth – This function uses a reference parameter variables to accept an int arguments length and width. This function should ask the user to enter the rectangle’s length and width. Input validation: length and width should be positive integers. • calArea – This function should accept the rectangle’s length and width as arguments and return the rectangle’s area. The area is calculated by multiplying the (length * width).arrow_forwardMemory sticks (also known as USB flash drives) are extensively utilized in a variety of businesses. List two (2) advantages and two (2) disadvantages of utilizing memory sticks in commercial organizations, and explain why you chose them.arrow_forwardDefine a function drawCircle. This function should expect a Turtle object, the coordinates of the circle’s center point, and the circle’s radius as arguments. The function should draw the specified circle. The algorithm should draw the circle’s circumference by turning 3 degrees and moving a given distance 120 times. Calculate the distance moved with the formula 2.0 × π × radius ÷ 120.0. Define a function main that will draw a circle with the following parameters when the program is run: X = 50 Y = 75 Radius = 100arrow_forward
- Design a circuit that multiply two 2 bit numbers ( A1A0 , B1B0) by using 4-to-16 Decoder.arrow_forwardDefine a function drawCircle. This function should expect a Turtleobject, the coordinates of the circle’s center point, and the circle’s radius as arguments. The function should draw the specified circle. The algorithm should draw the circle’s circumference by turning 3 degrees and moving a given distance 120 times. Calculate the distance moved with the formula 2.0 × π × radius ÷ 120.0. Define a function main that will draw a circle with the following parameters when the program is run: X = 50 Y = 75 Radius = 100arrow_forwardI got wrong answer from you guys. Now don't give wrong answer or Don't use Al tool to generate answer. If I see these things I'll report your account.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education