Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING REPL.IT FOR YOUR CODING ASSIGNMENTS. Sign up for repl.it its free. https://repl.it/ Create a new Repl as shown below. On this screen shot, youll

USING REPL.IT FOR YOUR CODING ASSIGNMENTS.

Sign up for repl.it its free. https://repl.it/

Create a new Repl as shown below. On this screen shot, youll see existing repls that Ive created earlier. When your account is brand new, you wont see any repls yet.

Complete the following assignment, providing the URL ONLY from Repl.it, for each problem below, in your submission.

Remember to DEFINE, then SOLVE.

1. Write a Python program which accepts the user's first and last name and prints them in reverse order with a space in between the names.

Your answer should look something like this:

Input your First Name:

Input your Last Name:

Hello

2. Write a Python program which accepts the radius of a circle from the user and computes the area of the circle.

NOTE: Radius is defined as a line from the center of the circle to the outside border of the circle.

NOTE: To accomplish this task, you'll need to import pi from math, like this: from math import pi

The formula you'll use for this problem is: str(r) + " is: " + str(pi * r**2

Dont forget to use FLOAT you want decimal points and numbers after the decimal point to show.

Your answer should look something like this:

Input the radius of the circle: 1.1

The area of the circle with radius 1.1 is: 3.8013271108436504

3. Write a Python program which accepts a sequence of comma-separated numbers from a user and generate both a list and a tuple with those numbers.

Remember that a Python list is a container which holds comma separated values (items or elements) between square brackets where items or elements need not all have the same type. In general, we can define a list as an object that contains multiple data items (elements). The contents of a list can be changed during program execution. The size of a list can also change during execution, as elements are added or removed from it.

Remember that a Python tuple is a container which holds a series of comma separated values (items or elements) between parentheses such as an (x, y) co-ordinate. Tuples are like lists, except they are immutable (i.e. you cannot change its content once created) and can hold mix data types.

Your answer should look something like this:

Input some comma separated numbers: 3,5,7,23

List : ['3', '5', '7', '23']

Tuple : ('3', '5', '7', '23')

4. Write a Python program that will convert your height from feet and inches, to centimeters. Be sure to explain to possible users what the program will do.

Your answer should look something like this:

This program will tell you what your height is in centimeters.

Input your height:

Feet: 4

Inches: 6

Your height is: 137 cm.

5. Write a Python program to print the calendar of a given month and year.

NOTE: Don't forget to start by importing the 'calendar' module.

Your answer should look something like this:

Input the year: 2017

Input the month: 04

April 2017

Mo Tu We Th Fr Sa Su

1 2

3 4 5 6 7 8 9

10 11 12 13 14 15 16

17 18 19 20 21 22 23

24 25 26 27 28 29 30

6. Write a Python program that will take a number of feet being input by a user, and convert the feet to inches, yards, and miles. The results of this conversion will be displayed when the program is run.

Your answer should look something like this:

Input distance in feet: 89

The distance in inches is 1068 inches.

The distance in yards is 29.67 yards.

The distance in miles is 0.02 miles.

7. Write a Python program to display the first and last colors from the following list.

color_list = ["Red","Green","White" ,"Black"]

Your answer should look something like this:

Red Black

8. Write a Python program to calculate number of days between two dates. The function looks like this:

Python datetime.date(year, month, day) :

The function returns date object with same year, month and day. All arguments are required. Arguments may be integers, in the following ranges:

MINYEAR <= year <= MAXYEAR

1 <= month <= 12

1 <= day <= number of days in the given month and year

If an argument outside those ranges is given, ValueError is raised.

NOTE: The smallest year number allowed in a date or datetime object. MINYEAR is 1.

The largest year number allowed in a date or datetime object. MAXYEAR is 9999.

Your answer should look something like this:

12

9. Write a Python program to find whether a given number (accept input from the user) is even or odd, and print out an appropriate message to the user.

Your answer should look something like this:

Enter a number: 78

This is an even number.

10. Write a Python program to create a histogram from a given list of integers. A histogram is a representation of the distribution of numerical data. It's a kind of bar graph.

Your answer should look something like this, because youll define what the histogram will look like, in your program:

**

***

******

*****

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions