What is wrong with this code? TypeError: 'float' object is not iterable
Hey, guys! I'm trying to create a program that makes a logistic map. I use two files for that: First: def log_map(x,r,n): """ Creates a logistic map with initial value x, a parameter r and a number of iterations n. """ for i in range(n): if i==0: y = list(x) y.append(r*x*(1.-x)) else: y.append(r*y[i-1]*(1.-y[i-1])) return y Second: from log_map import log_map x = input("Enter x: ") r = input("Enter r: ") n = input("Enter n: ") y = log_map(x,r,n) print(y) It opens normally and asks for the correct inputs, but then it gives the message "TypeError: 'float' object is not iterable". I don't understand what the problem really is... Could you help me?