Python Forum
Where to look to find the most recent Python grammar
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where to look to find the most recent Python grammar
#1
Hello, Python world!

I recently started studying Python with the book called 'Python Crash Course' by Eric Matthes.
It has been very entertaining so far without any major problem. (I'm in chapter 6 now)

When I compare my codes for exercise to the answers on his website, however,
I notice some differences. Everything works fine, btw.

For example, The answer on the website is
print("Hello " + username + ", thank you for logging in again!")
and
Mine is
print(f"Hello {username}, thank you for logging in again!")

I assume that format for using variable in print is slightly dated, although it works.
So, finally my question is,
Where do I need to go to keep myself updated with the most recent python grammar?
(Please forgive me if the expression grammar is wrong)

Thank you in advance.
Reply
#2
Either version works fine. Yours is actually the most recent way of formatting strings. This is really just a difference in the features available in the different versions of Python. If you go to the current documentation, you'll see a link to "What's new in Python 3.7." Each new version has one of those. You'll notice a drop down at the top of the page that let's you select previous versions. So you can read all of those since whatever version the book is using (it should say in the beginning), and learn all of the new features since the book was written.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
Your code is more modern, the author's is out of date. In fact, I'm a little surprised they didn't use the format method instead of string concatenation.

You can follow the release notes to see the latest. You can follow PEPs if you want to stay on the bleeding edge. And I personally get most of my updates from here, and some from Google Now.
Reply
#4
(Oct-02-2019, 05:31 PM)allusernametaken Wrote: Where do I need to go to keep myself updated with the most recent python grammar?

Hi!

I'm also a newbie, and maybe one of the best ways to be informed of the latest news in Python is:

https://docs.python.org/3/library/string...ule-string

but if you are a newbie like me, without a previous programming background, you'd probably find it too extense and not geared to newbies, although it can help for specific things or if you have a programming background.

I personally find it more useful to me, sites like this one, Python-forum, or another site that I find more newbie friendly than Python docs, and it's this one:

https://realpython.com/python-f-strings/

https://realpython.com/python-string-formatting/

that even not being as comprehensive and up to date as Python docs, I find it easier to understand than that one.

I hope it helps.

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#5
Thank you all!
I wanted to give everyone reputation but I didn't know my account's allowed for giving only 2 a day.
Damn. Sorry newbieAuggie2019 :(
Reply
#6
(Oct-02-2019, 11:37 PM)allusernametaken Wrote: Thank you all!
I wanted to give everyone reputation but I didn't know my account's allowed for giving only 2 a day.
Damn. Sorry newbieAuggie2019 :(

Don't worry!

I'm not here to win points or likes. My motivation is to help if I can. Thumbs Up Type

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#7
Hi, I'm the author of Python Crash Course. It sounds like you're using the second edition of the book, but looking at the online resources for the first edition.

The online resources for the second edition are here: https://ehmatthes.github.io/pcc_2e/
Reply
#8
newbieaussie, that's awesome. so i came back and did reputation for you haha

ehmatthes, wtf? it's nice to meet you. Thank you for your book and resource.
Reply
#9
Nice to meet you! And you're very welcome. I keep an eye out for questions people are asking about the book. :)
Reply
#10
(Oct-04-2019, 02:36 AM)allusernametaken Wrote: newbieaussie, that's awesome. so i came back and did reputation for you haha
Smile Very kind of you to come back just to give me some reputation!

A simple 'Thank you!' would have been enough for me, but I do appreciate your kindness. Blush

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  AttributeError Traceback (most recent call last) quest 5 5,110 Mar-31-2021, 01:34 PM
Last Post: quest
  Text file parsing with python and with a list in grammar pitanga 2 3,240 Aug-31-2017, 02:21 PM
Last Post: pitanga

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020