Concept: Format Input
Formatting string input()
When storing input, sometimes a specific format is needed and formatting is applied to the input() function
Note: this technique overwrites the original user input in the variable with the formatted value
Example
review and run code - test a capitalized color input
fav_color = input('What is your favorite color?: ').lower()
print(fav_color)
Task 2
[ ] format input() with .upper()
[] input variable fav_color as upper
[] print fav_color
In questa pagina del sito puoi guardare il video online input formatting - Introduction to Python: Absolute Beginner Module 1 Video 22 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Book Simplifiers 27 luglio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 127 volte e gli è piaciuto 7 spettatori. Buona visione!