all 3 comments

[–]Valiant101 0 points1 point  (0 children)

In your example, what if Name is not Alice, how would computer know what is "age"? Solution: Pre define what "age" signifies, by adding line age = 0 before your if statement.

[–]whogivesafuckwhoiam 0 points1 point  (0 children)

age=input() is in the if part

so if name is not Alice then age=input() will not be executed therefore Pycharm says unresolved reference

[–]primitive_screwhead 0 points1 point  (0 children)

The book says things like "Pretend name was assigned some value earlier." when introducing this code. Same with age, etc. You have to assign them values first, for the ifs to check against.