Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Statement 1) Write Python code that prompts the user to input a number (n). Then your code will list all the numbers (1 -

image text in transcribed
Problem Statement 1) Write Python code that prompts the user to input a number (n). Then your code will list all the numbers (1 - n) with a comma after each number except for the last number. There should be 10 numbers per line. For extra credit write two complete versions, i. Using a for-loop structure ii. Using a while-loop structure Example: If user input was 8 or 30 your result should look as shown below. Your code is running at https://python-lect Important: use os.getenv(PORT, 808e) as theImportant: use os.getenv(PORT, 8080) as the por Your code is running at https://python-lecturesits How many numbers would you like to add? 8 1, 2, 3, 4, 5, 6, 7, 8 Sum- 36 Average 4.5 How many numbers would you like to add? 30 1,2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 Process exited with code: um 465 Average= 15.5 Process exited with code

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

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago