Ask Question, Ask an Expert

+1-415-315-9853

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

Write a python program to encode the plain text message and

Write a Python program to encode the plain text message and another Python program to decode the encoded message. Use the following as starter code: # # HW 5 Caesar Cipher: Encoder # Do not modify next 8 lines def encode ...

Objectivesthe objectives of this assignment are- to gain

Objectives The objectives of this assignment are: - To gain experience in designing algorithms for a given problem description and implementing those algo- rithms in Python 3. - To demonstrate the ability to: - Implement ...

Pythonprofessor merlin has asked you to help him he has 30

Python Professor Merlin has asked you to help him. He has 30 total students in his class, but he is not sure that all of them took his last exam. He wants to average the grades for his last exam in his medieval literatur ...

Python program super pongyour version of pong will be more

Python program: super pong Your version of pong will be more complete and have the following features at a minimum: 1) The scores for each player should be displayed 2) Option for ball speed - Choose between three differ ...

Write a python script that will implement the following

Write a python script that will implement the following command: merge sourcedirectory1 sourcedirectory2 destinationdirectory The idea is that the contents of sourcedirectory1 and sourcedirectory2 are going to be copied ...

Opengl programming in python 35write a program to render an

OpenGL Programming in Python 3.5 Write a program to render an animated humanoid walking robot. Specifications: Robot's body is a parallelogram box. Robot's head is a sphere. Robot's height is 60. Your robot must have two ...

Taskyou are to plan and then code a console-based program

Task: You are to plan and then code a console-based program in Python 3, as described in the following information and sample output. This assignment will help you build skills using selection, repetition, file input/out ...

Lab 1 functionslearning objectives for this lab include1

Lab 1: Functions Learning Objectives for this lab include: 1. Understand how functions work. 2. Know how to define and call a function. 3. Learn how to declare local variables. 4. Learn how to pass arguments to functions ...

P Programming in Python CS21A Lab I: Lists and Tuples - Files

Programming in Python CS21A Lab I: Lists and Tuples - Files Learning Objectives for this lab include: - Understand list basics including elements and subscripts. - Learn how to find high and low values of a list. - Learn ...

Python codeyour version of pong will be more complete and

Python Code Your version of pong will be more complete and have the following features at a minimum: 1) The scores for each player should be displayed 2) Option for ball speed - Choose between three different speed level ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen