Implement program first with a while loop

Assignment Help Python Programming
Reference no: EM132167842

1. Write a program that counts down from 10. Implement your program first with a while loop. Now implement your program with a for loop. Include both versions in your submission file.

2. Write a program that prints 2n where n goes from 1 to 100. Print one answer per line (note: you are answering the question. how high can you count on 100 fingers). Write your program using a 'for' loop. Reminder '•" is the operator for exponents. so for example 4"3 is 4 to the third power. or 4 4 4 which equals 64.

E.g.

2

4

8

16

3. Extend your guessing game from last week. Write a program that picks a random number from 1-100. Then ask the user to guess a number. Tell the user if the answer is higher or lower than the number they guessed. or if they got the correct answer. Allow them to guess again if they got the guess incorrect. They should be able to guess numbers an infinite number of times until they get the correct answer, at which point your loop will end. To generate a number from 1-100 you will need the following code at the beginning of your program:

from random import randint

randomNum = randint(1, 100)

4. Extra Credit - 5 possible points - Write a program that generates the multiplication table for numbers 1-10. Use two for loops to complete your program. You will need to put one for loop inside of the other for loop. As an extra challenge, see if you can get the indention to look correct. So the output of your program should be:

1480_figure.jpg

Verified Expert

The task of the assignment is to solve 4 python program. First program counts down the value from 10 to 1 and displays it. The second python program computes 2^n value for n from 1 to 100. Third program is the number guessing game that checks whether the guess is higher or lower than the guessed value. The final program displays the multiplication table from 1 to 9. The python program is computed and the output of the assignment is attached in the documentation of the assignment.

Reference no: EM132167842

Questions Cloud

Annual growth rate in west springfield : Assume real per capita GDP in West Springfield is $8000 while in East Quippanova it is $2000. The annual growth rate in West Springfield is 2.33%
Explain what is meant by the term synoptic gospels : Explain what is meant by the term "synoptic gospels," and discuss why this term is important for Christians when reading the Bible.
What strategic initiatives did howard schultz : What strategic initiatives did Howard Schultz put in place to re-create Starbucks' uniqueness after his return in 2008?
Write a persuasive essay on the given topic : Using the Horn Nord, Paliszkiewicz and Koohang article in the readings and one additional source from the Library, write a persuasive essay.
Implement program first with a while loop : Implement program first with a while loop. Now implement your program with a for loop. Include both versions in your submission file
What happens to total tax revenue collected : Owing to the positive IS shock, what happens to total tax revenue collected?
Relationship between product design and process selection : What is the relationship between product design and process selection, i.e., how does product design influence the type of process to be used,
Explain how companies create customer-centered businesses : Explain how companies create customer-centered businesses. Explain how customer-centered businesses impact the consumer decision-making process.
Price elasticity of demand for the products : Jane is named head of business strategy for a given business. The price elasticity of demand for the products (or services) sold by this business is 0.7.

Reviews

Write a Review

Python Programming Questions & Answers

  Describe the standard library modules

Find where the Python executables and standard library modules are installed on your system.

  The interest rate per period

The interest rate per period. For example, if your loan's interest is 6.5% per year, and you are paying monthly, this would be 6.5%/12. If you are paying every two weeks, r would be 6.5%/26, because there are 26 two-week periods in a year.

  Create a child class of basepage for the catalog home page

CS 4320 Homework - Use Python unittest and Selenium WebDriver to create some tests for parts of our university catalog website

  Write a short program in python that turns on all leds

Write a short program in Python that turns on all LEDs, one at a time, in a looping fashion. When an LED is on, it should stay on for 1 second.

  Develop a system for the Complex Word Identification

Class project: Complex Word Identification. The goal of the lab is to develop a system for the Complex Word Identification shared task

  What python ides are being used in the industry

An IDE is an Integrated Development Environment. It is the application used to create applications and code. What Python IDEs are being used in the industry?

  Implement an automatic quality assurance process

Implement an automatic quality assurance process for their product. They have recently transitioned from hardware calculators to software calculators

  Write a python program to demonstrate a theme for your robot

Write a Python program to demonstrate a theme for your robot. Your team must think of something fc your robot to do using the sensors and/or motors.

  Write a python script that builds an html file

Write a Python script that builds an HTML file of your own design. Add an image tag into your HTML and link it to an image on your hard drive.

  Develop a list of requirements that could have been used

Develop a list of requirements that could have been used to create the original file.py (specify requirements in any format you desire) as written.

  Create a dictionary from the boys txt file

Create a dictionary from the boys.txt file that uses the boys' names as the key and the number of boys that were named that name as the value.

  Python project description

Grep all required data listed from the 1) to 7) and construct required run file for each step (pnr, drc, lvs, syn, pwr)based upon the choice of technology and process when executing your script.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd