We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d4ee06 commit 8cae80fCopy full SHA for 8cae80f
chaos.py
@@ -2,7 +2,17 @@
2
3
def main():
4
print ("This program illustrates a chaotic function")
5
- x = float((input("Enter a number between 0 and 1: ")))
+
6
+ while True:
7
+ try:
8
+ x = float((input("Enter a number between 0 and 1: ")))
9
+ if (0 < x and x < 1):
10
+ break
11
+ else:
12
+ print("Please enter correct number")
13
+ except Exception as e:
14
15
16
for i in range(10):
17
x = 3.9 * x * (1-x)
18
print (x)
0 commit comments