()
| 2 | |
| 3 | |
| 4 | def main(): |
| 5 | print("This program illustrates a chaotic function") |
| 6 | |
| 7 | while True: |
| 8 | try: |
| 9 | x = float((input("Enter a number between 0 and 1: "))) |
| 10 | if 0 < x and x < 1: |
| 11 | break |
| 12 | else: |
| 13 | print("Please enter correct number") |
| 14 | except Exception: |
| 15 | print("Please enter correct number") |
| 16 | |
| 17 | for i in range(10): |
| 18 | x = 3.9 * x * (1 - x) |
| 19 | print(x) |
| 20 | |
| 21 | |
| 22 | if __name__ == "__main__": |