Today we are going to see python print statement usage.
Print is used to print the output in the console.
print("Hello, World!") # Output: Hello, World!
print(123) # Output: 123
print(3.14) # Output: 3.14
print("The answer is", 42) # Output: The answer is 42
name = "Alice"
age = 30
print(f"My name is {name} and I am {age} years old.") # Output: My name is Alice and I am 30 years old.
print("Python", "is", "fun", sep="-") # Output: Python-is-fun
print("This is the first line.", end=" ") # Output: This is the first line. This is the second line.
print("This is the second line.")
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3