Python print ()

karthick_selvam

Karthick Selvam

Posted on July 10, 2024

Python print ()

age = 999999999
name ='yaman'
place ="yamalogam"
print("hellow yamalogam!!") ##The Basics: Printing a String
print(age,name,place) ##Printing Variables
print("Name", name, "age", age, "place", place ) ##Printing Multiple Items
print(f"Name {name} age {age} place {place}") ##Formatted Strings with f-strings
print(name + "!" + place + "!") ##Concatenation of Strings
print("hellow","yamalogam", sep="---" ,end="!") ##separate the objects,Using sep and end Parameters
print("rambha\nmenaka\nurvashi") ##Using Escape Sequences next line
print("rambha\tmenaka\turvashi") ##Using Escape Sequences next Tab
print('"yamman", yamalogam') ##Printing Quotes Inside Strings
print("C:\yamalogam\bologam") ##Escape Sequences
print(r"C:\yemalogam\bologam") ##Raw Strings to Ignore Escape Sequences
print(9999) ##Printing Numbers You can print numbers directly without quotes.
print(9*9) ##Printing Results of Expressions and all mathematical equations
weapon= ['pasakairu','thandayutham','guptha']
print(weapon) ##Printing Lists and Dictionaries
person= {"name" : "guptha", "age" : 21 , "city" : "yamalogam"}
print(person) ##Printing Lists and Dictionaries
print("""'this place
is
yamalogam'""") ##Multiline Strings with Triple Quotes
print()

and the output of my code

Image description

💖 💪 🙅 🚩
karthick_selvam
Karthick Selvam

Posted on July 10, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related