{"id":517,"date":"2011-01-25T14:51:13","date_gmt":"2011-01-25T14:51:13","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2011\/01\/25\/python-print-module-examples\/"},"modified":"2021-07-24T18:35:49","modified_gmt":"2021-07-24T18:35:49","slug":"python-print-module-examples","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Programming\/Python\/python-print-module-examples.html","title":{"rendered":"Python – Print Examples"},"content":{"rendered":"
Below is a small example to show some of the various way in which print can be called within Python.<\/p>\n
quote = \"A person who never made a mistake never tried anything new.\"
print(\"ORIGINAL\")
print(quote)
print(\"\\nUPPERCASE\")
print(quote.upper())
print(\"\\nLOWERCASE\")
print(quote.lower())
print(\"\\nTITLE\")
print(quote.title())
print(\"\\nREPLACE\")
print(quote.replace(\"person\", \"banana\"))<\/pre>\nOutput<\/strong><\/h4>\n
[root@linux]# python print_example.py
ORIGINAL
A person who never made a mistake never tried anything new.
UPPERCASE
A PERSON WHO NEVER MADE A MISTAKE NEVER TRIED ANYTHING NEW.
LOWERCASE
a person who never made a mistake never tried anything new.
TITLE
A Person Who Never Made A Mistake Never Tried Anything New.
REPLACE
A banana who never made a mistake never tried anything new.<\/pre>\n[root@Fileserver python]# python string_manip.py<\/div>\n","protected":false},"excerpt":{"rendered":"Below is a small example to show some of the various way in which print can be called within Python. quote = “A person who never made a mistake never tried anything new.”print(“ORIGINAL”)print(quote)print(“\\nUPPERCASE”)print(quote.upper())print(“\\nLOWERCASE”)print(quote.lower())print(“\\nTITLE”)print(quote.title())print(“\\nREPLACE”)print(quote.replace(“person”, “banana”)) Output [root@linux]# python print_example.py ORIGINALA person who never made a mistake never tried anything new.UPPERCASEA PERSON WHO NEVER MADE A MISTAKE … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"yoast_head":"\n
Python - Print Examples - Fir3net<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n