Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Python Expert

PROGRAM: LOOPS AND IF CONDITIONS

prepare a program that requests a password after the author/program information is displayed. Make the password “hello”. The program should then ask the user for their name: if the name entered is the same as your name, the program should respond with

“What a great name!” if they enter “Madonna” or “Cher”, the program should respond

“May I have your autograph, please?” For any other input, the program should respond with “(input name), that’s a nice name”.

SAMPLE OUTPUT (including author/program information)

Program author: Barney Rubble

ID#: 1234567

Program: LOOPS AND IF CONDITIONS

Password? unicorn

Password? opus

Password? hello

Welcome to the second half of the program!

What is your name? Barney

What a great name!

Alternate Outputs

What is your name? Cher

May I have your autograph, please?

What is your name? Bill

Bill, that’s a nice name.

PROGRAM:FUNCTIONS

Reprepare the area.py program (shown below, or in the Creating Functions section of the tutorial) so that it has separate functions for the perimeter and area of a square, a rectangle, and a circle (3.14 * radius**2). This program should include a menu interface that has ‘exit the program’ as one of its choices.

SAMPLE PROGRAM EXECUTION:

Area.py

#This program find outs the perimeter and area of a rectangle

print “find out information about a rectangle”

length = input(“Length:”)

width = input(“Width:”)

print “Area”,length*width

print “Perimeter”,2*length+2*width

SAMPLE OUTPUT (not including author/program information)

CALCULATIONS MENU:

1) AREA (SQUARE)

2) AREA (RECTANGLE) 3) AREA (CIRCLE)

4) PERIMETER (SQUARE)

5) PERIMETER (RECTANGLE)

6) PERIMETER (CIRCLE)

7) EXIT

INPUT MENU CHOICE (1,2,3,4,5,6 OR 7)? 2

YOU HAVE CHOSEN AREA (RECTANGLE)

INPUT WIDTH? 8

INPUT LENGTH? 4

AREA IS 32

INPUT MENU CHOICE?

Python, Programming

  • Category:- Python
  • Reference No.:- M990

Have any Question?


Related Questions in Python

Question a software company sells a package that retails

Question : A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10 - 19 20% 20 - 49 30% 50 - 99 40% 100 or more 50% Write a program usi ...

Simple python traffic lightswrite a program that simulates

Simple Python (Traffic lights) Write a program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green. When a radio button is selected, the light is turned on, and onl ...

Environment setupthe first mini project will be based on

Environment Setup The first mini project will be based on Ladder Logic programming. We will be using Schneider Electric's IDE called SoMachine Basic to do the programming. The latest ver- sion of SoMachine Basic for Wind ...

Show times in tmus and seconds1 an associate grasps an oven

Show times in TMUs and seconds. 1. An associate grasps an oven door within reach and pulls it open 18 inches with the left hand (he does not relinquish control of the door). With a pan in the right hand, he carefully pos ...

The second task in this assignment is to create a python

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3) Problem Task In this problem, your input w ...

Question write a simple python program that takes use

Question: Write a simple python program that takes use inputs as non-zero digits and converts them into binary form. The response must be typed, single spaced, must be in times new roman font (size 12) and must follow th ...

Question research pythons dictionary data type dictdiscuss

Question : Research Python's dictionary data type (dict). Discuss its interface and usage. Include examples. Discuss practical applications of dictionaries.

Assignment1 utilising python 3 build the following

Assignment 1. Utilising Python 3 Build the following regression models: - Decision Tree - Gradient Boosted Tree - Linear regression 2. Select a dataset (other than the example dataset given in section 3) and apply the De ...

Question write a python program with a graphical user

Question: Write a python program with a graphical user interface that will allow a user to create a custom pizza which they wish to order. At minimum, the user should be able to choose the size of the pizza, the type of ...

In this programming assignment you will write a client

In this programming assignment, you will write a client pingprogram in Python. Your client will send a simple ping message to a server, receive a correspondingpong message back from the server, and determine the delay be ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As