DEV Community

Cover image for Day 8 of Documenting my Learning Journey
James Kabuga
James Kabuga

Posted on

Day 8 of Documenting my Learning Journey

What I did Today
1.Learnt about string formatting using f-strings
2.Tracked, committed and pushed my python scripts to my public repository python-concepts.

On what I learnt

Earlier I had learnt about string operations and to be specific concatenation.
In concatenation it was all about combining strings together which have been stored in variables.
Here for one to separate each string one had to keep inserting commas after every string which is disadvantageous as it is tiresome for long strings.

This is where string formatting using f-strings comes in..

How do we incorporate f-strings

  1. We have strings stored in variables. 2.During printing we specify by using f and the names inside curly braces. Example: print(f"My name is" {name})

See example below in action:

Resources I used
1.Refresher python series by Bonaventure Ogeto on Youtube.
2.Github for committing and pushing my work.

What's Next

Tomorrow I'll be doing a mini-project to apply and reinforce what i learnt in the last 5 days.

Top comments (0)