Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4.1 Stay under 80 characters on all code and comment lines Ask for input() with descriptive prompts telling users what is expected o Especially remember

4.1 Stay under 80 characters on all code and comment lines Ask for input() with descriptive prompts telling users what is expected o Especially remember to tell user what delimiter youre expecting when using split() Make sure to validate user input for data type, value range and other problem requirements Print output that clearly explains what is being printed (where necessary) o In other words, dont just print a 5 unless its clear what that 5 represents. Import statements should be immediately after the program docstring Make sure to include # line comments (just a few in each program, dont go crazy) Use snake_case (lower case plus underscores) for variables CONSTANT variables must be all upper case and immediately following any import statements Do NOT create user defined functions for this assignment. Only base python functions and methods can be used, along with those in the modules listed below. Modules Allowed You may only import the following modules into your programs and use their methods and attributes, unless first receiving special (and unlikely) permission from your facilitator: math operator os re string sys

Q\ Write a python program to solve the following: a. Create a constant list with the integers from 55 to 5, but only every 10th number (see example). Set this up using the python range function b. Generate a new list with same number of elements as the original list such that each integer in the new list is the sum of its nearest neighbors and itself from the original list. The integers at the beginning and end of the list only have one nearest neighbor c. Print both lists with descriptions. Your code should be able to work with an integer list of any size. Example of Output: Input List: [55, 45, 35, ] Result List: [100, 135, ]

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago