calthoff / self_taught

This repository contains the exercises for "The Self-Taught Programmer: The Definitive Guide to Programming Professionally."
http://theselftaughtprogrammer.io
267 stars 226 forks source link

Syntax error while using result while using Python 3.7.0a4 shell #16

Closed arunchandy closed 6 years ago

arunchandy commented 6 years ago

After naming and defining function, python is not taking result line. The error is attached. Lines look like this

def f(x): return x * 2 result = f(2) SyntaxError: invalid syntax

j9dctwl

calthoff commented 6 years ago

You have to hit enter first after you type the function. Then you type result = f(2). Or don't use the shell and save the program in IDLE.

arunchandy commented 6 years ago

Thanks....but its still not working on shell. I saved in IDLE, that's the only way its running.