Nov-05-2016, 06:14 PM
You have main() within the def but I don't think it should be there.
I have modified the code somewhat because a copy and paste kept giving an error ( saved it as guest.py )
I have modified the code somewhat because a copy and paste kept giving an error ( saved it as guest.py )
Quote: File "./guest.py", line 5I think your code should be more like this:
SyntaxError: Non-ASCII character '\xc2' in file ./guest.py on line 5, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
#!/usr/bin/env python def main(): inp = raw_input("Enter a value between 0 and 1: ") x = float(inp) for i in range(10): x = 3.9 * x * (1 - x ) print x main()It printed out the following:
Quote:/test1$ ./guest.pyI hope this helps you
0.975
0.0950625
0.335499922266
0.869464925259
0.442633109113
0.962165255337
0.141972779362
0.4750843862
0.972578927537
0.104009713267