Lesson 10 Discussion & Wiki (2019)

Right, it will fail if input is used in the function (or the same scope).

The following is legal:

def times5(input):
    print(int(input) * 5)

ip = input("Enter a number")
times5(ip)

which is how pytorch and fastai use the variable input.

The following is not:

input = input("Enter a number")
input
input("Enter another number") #will fail
1 Like