print function python code example

Example 1: how to print in python

print("hello world")

Example 2: python print

# This is a print statement
print("Hello, world!")

Example 3: python print

# To print a string...
print("I am a string yay")

# To print an answer to an equation...
print(5+5)

# To print the answer of previously defined variables...
x = 50
n = 30
print(x + n)

# Notes:
# You can't add a string to a number.
x = "foo"
n = 50
print(x + n)
# That will come up with an error.

Example 4: print function python

print("Hello World")

Example 5: print function python

datacamp tutorial on python print function

Example 6: print function python

print('datacamp','tutorial','on','python','print','function',sep='\n') #`\n` will put each word in a new line

Tags:

Php Example