Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4232318
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:04:45+00:00 2026-05-21T02:04:45+00:00

Here is the question proposed by the text. Write an improved version of the

  • 0

Here is the question proposed by the text.

Write an improved version of the Chaos program from Chapter 1 that allows a user to input two initial values and the number of iterations and then prints a nicely formatted table showing how the values change over time. for example, if the starting values were .25 and .26 with 10 iterations, the table would look like so:

following this is a table with a index 0.25 0.26 as headers and then the 10 iterations in two columns.

here is my initial Chaos program.

# File: chaos.py

def main ():
    print ("This program illustrates a chaotic function")
    x=eval (input("enter a number between 0 and 1: "))
    for i in range (10):
        x = 3.9 * x * (1-x)
        print (x)

main()

my question is how do i change it to fulfil the above question..

Please if answering take in mind this is my first programming class ever.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:04:46+00:00Added an answer on May 21, 2026 at 2:04 am

    You really just have to duplicate the functionality you already have. Instead of just asking the user for an x value, also ask for a y value.

    x= float(input("enter a number between 0 and 1: "))
    y= float(input("enter another number between 0 and 1: "))
    

    Then in your loop you need to do the same thing you did with the x value to the y value. When you print, remember that you can print two values (x and y) at once by separating them with a comma.

    Also, as PiotrLegnica said, you should use float(input(…)) instead of eval(input(…)). Since you know that the user should enter a floating point number (between 0 and 1) you don’t have to call eval. Calling eval could be dangerous as it will execute any instruction given to it. That might not matter right now, but it’s better to not get in the habit of using it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first question here. I'm developing a program in C# (.NET 3.5) that displays files
C# question here.. I have a UTF-8 string that is being interpreted by a
I found a question here about blogs on software development, but I would like
this is my first question here so I hope I can articulate it well
There is a similar question here but it only covers some of the issues
Based on my previous question here my new concern is how do I unit
Pardon the dumb newbie question here; web programming isn't my forte... (blush) I have
I was going to ask a question here about whether or not my design
Forgive me for a potentially silly question here, but in other programming languages (scripting
As a secondary method to my question here: Show Cell Range on UserForm; then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.