Friday, 18 February 2022

Modify the chaos program so that it prints out 20 values instead of 10.

 

CODE

def main():

    print("This program illustrates a chaotic function")

    x = eval(input("Enter a number between 0 and 1: "))

    for i in range(20):

        x = 3.9 * x * (1 - x)

        print(x)


main()

Note : Save above code as chaos_v3.py

SCREENSHOT




No comments:

Post a Comment