cat
0
Q:

print python

print("hello world")
0
# This is a print statement
print("Hello, world!")
26
print('Hello, world!')
19
print("Hello World")
-1
#Normal:#
print("Hiya Grepper!") #Output: Hiya Grepper!#
#As Equation:#
print(1+1)  #Output: 2#
#With String Variables:#
x = 'Pog'
print(x + 'Champ') #Output: PogChamp#
#With Integer Variables:#
y = 9999
z = str(y)
print('You have ' + z + ' IQ') #Output: You have 9999 IQ#
#NOTE: Not converting the int variable to a str variable will return an error#
9
# Rainy Day
wet = 'umbrella'
print(wet)
# Sunny Day
hot = 'sunglasses'
print(hot)
4
# 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.
11
#a string, to indicate it is a string you can use ("") or ('')
print("hello world")
#a integer 
print(19)
# a float:
print(4.5)
6
'''
print()inside the parentheses put a single colon or double colon 
'''
# example like this
print("this how you use print statement")
# or like this
print('other way to print in python')
3

New to Communities?

Join the community