0
Q:

how to print python text

print("The text you want to print")
1
print ("Example")
0
# To print a string use quotation marks
print("Hello world!")
Hello world!

# To print a variable, use the name of the variable without quotation marks
x=10
n = "Hi!"
print(x)
10
print(n)
Hi!

# Print arguments can also be calculations
x=5
y=10
print(x+y)
15
print(y/x)
2

# To print both a variable and a string at once, use a comma (,) (this also acts as a space)
x= "Max"
print("My name is", x)
My name is Max
1

New to Communities?

Join the community