<jupyter_start><jupyter_text>Print FormattingPython has a long history of trying to format strings (and print statements) in different ways. In Python 3.5 this became easier with `.format()` and in Python 3.6 we got f-strings, a nicer way to format variables inside of a string.   .format() with Python 3.5 and earlier<jupyter_code>course = "Python for Everybody"
print("The course you are in is {}".format(course))
greeting = "Welcome {}, you are sitting in {}".format("Kalob", course)
greeting
!python -V<jupyter_output>Python 3.7.2<jupyter_text>> **Note**: If you want to run a command as if you were on the command line, you can start any command with `!` and it'll execute it as if you were running the command from Bash, cmd/Power Shell, or Terminal.  f-strings with Python 3.6 and later<jupyter_code>name = "Henry"
f"Hello {name.upper()} welcome to {course.swapcase()}" # >= 3.6<jupyter_output><empty_output><jupyter_text>Example<jupyter_code>user_name = input("What is your name? ")
print(f"Hello {user_name}, welcome to Python!")<jupyter_output>What is your name? @KalobTaulien
Hello @KalobTaulien, welcome to Python!
{'fraction_non_alphanumeric': 0.11012433392539965, 'fraction_numerical': 0.011545293072824156, 'mean_word_length': 5.5523255813953485, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '466042', 'license': 'MIT', 'n_tokens_mistral': 371, 'n_tokens_neox': 352, 'n_words': 140, 'path': '160_Print_Formating.ipynb', 'repo_name': 'PacktPublishing/Python-for-Everybody-The-Ultimate-Python-3-Bootcamp', 'size': '1126'}