Jan-28-2019, 03:54 PM
Hello everyone,
i am a complete python beginner, so I have a very basic question that i couldn't resolve on my own.
I am trying to make use of f-string. I have the newest IDLE version installed on a mac (Python 3.7.2). I wrote the following script, named f.py:
i am a complete python beginner, so I have a very basic question that i couldn't resolve on my own.
I am trying to make use of f-string. I have the newest IDLE version installed on a mac (Python 3.7.2). I wrote the following script, named f.py:
name = "Eric" age = 74 f"Hello, {name}. You are {age}."If I run this script I get nothing displayed in the shell, not even an error message. Just the restart message
================ RESTART: /Users/nadim/Documents/python/f.py ================ >>>If I however enter these three lines directly in the shell it works like a charm.
>>> name = "Eric" >>> age = 74 >>> f"Hello, {name}. You are {age}." 'Hello, Eric. You are 74.'I really would like to use f-strings in my scripts, but can't seem to get it working. Does anybody have an idea?