Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create code that creates the appropriate variables required including your value variable as well as your index variable. Write a while statement that will change

Create code that creates the appropriate variables required including your value variable as well as your index variable. Write a while statement that will change your variable to 255 from zero. This needs to be done in increments of 5. You will need to comment what variable is your index, define your conditional statement, and show where you increment index is located. Lastly your code needs to alert the user what the value of your variable is when the while statement has finished.
Your Code Part 1:
Copy and paste your code here.
Procedure:
Part 2: /20 marks
Now you will need to create a secondary code that follows the first one. This code will use a for statement to count your variable down from 255 back to zero. You will need to create a secondary variable as your index in the for statement. (It is understood you could still use the index from part 1 but create a secondary one to keep the indexes different). You should reduce the value of your primary variable by a unit other than 5. You have the freedom to choose this index amount, it just can not be 1. Once the variable has been counted back down to zero, alert the user with the value contained in your initial variable. Remember to check to ensure you do not have an off-by-one error for either parts of the code. create a python 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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

2. What are the prospects for these occupations?pg 87

Answered: 1 week ago