xxxxxxxxxx
#First name your variable. You can name the variable anything you want. I will name my variable "Fact".
fact = ("Grepper is good")
#You can see that after I named my variable I put the text I wanted to print in parenthasees and quotations. That is the text that will print.
print(fact)
#I told it to print my variable, Fact, because the text I wanna print, "Grepper is good", is equal to my variable, Fact. So, when I click run/start, it should print "Grepper is good".
#Feel free to use this code and edit it to your liking. Hope this helped!
xxxxxxxxxx
likes = 9999
print(f"A like if you love learning python with grepper. Likes:{likes}")
#or
print("A like if you love learning python with grepper. Likes:" + likes)
#or
print("A like if you love learning python with grepper. Likes:", likes)
xxxxxxxxxx
#How to print a variable the code below sets a variable to Hello, World!
variable = "Hello, World!"
#Use the print function to write out anything (the name variable after the print function is the name of the variable you want to print)
print(variable)
xxxxxxxxxx
#HOW TO PRINT A VARIABLE.
name = 'Wizard'
print(name)
#IT'LL PRINT THE VERY VARIABLE "name"
xxxxxxxxxx
pythonCopyvar1 = 123
var2 = 'World'
print("Hello to the",var2,var1)
xxxxxxxxxx
# Declaring a variable
name = 'John'
# Printing the variable
print(name)
# Declaring variables
name = 'John'
age = 30
# Printing the variables
print(name, age)
# Printing the variable using string formatting
print('My name is {}'.format(name))