Topic List | Page List: 1 |
---|---|
Topic | ITT: Learning Python |
SomeLikeItHoth 06/24/21 10:45:58 PM #9: | SpiritSephiroth posted... also learnt how to use lists and input various information while altering the values within them.You can use f strings when you're printing. name = input("Enter a name: ") age = input("Enter an age: ") race = input("Enter a race: ") print(f"My name is {name}. I am {age} years old and I am a {race}") Your print function will look similar to how you did it, but instead of adding the + age outside of the quotes, you just put the letter f in front of the double quotes, and instead of adding + age, you just put age in {} brackets. It's a lot simpler than having to go through the trouble of creating multiple quotes inside of a single print function, and it looks nicer. This guy has a great tutorial for beginners. https://www.youtube.com/playlist?list=PL-osiE80TeTskrapNbzXhwoFUiLCjGgY7 This channel has a lot of good videos. https://www.youtube.com/c/CodingTech/videos --- FAM FOREVER. ... Copied to Clipboard! |
Topic List | Page List: 1 |