“Fonction d'impression dans Python” Réponses codées

imprimé python

x = 10
y = 5
print(x)			# 10
print("x is ",x)	# x is 10
print(x,y)			# 10 5
print("sum of", x, "and", y, "is", x+y)   # sum of 10 and 5 is 15
mCar = "A"
print(mCar * y) 	# AAAAA
VasteMonde

Comment utiliser la fonction d'impression dans Python

print("What you would like to print :D")

#And then it will print in my case "What you would like to print :D" in the output
Jeppe Pro

imprimer en python

print("the sentence you want to print")
Expensive Emu

Fonction d'impression dans Python

print("hello, this is print function")
Coding boy Hasya

Fonction d'impression dans Python

# How to print in Python
print("Hello World!")
# How to print multiple words using comma separator
print("Hi", "there")
# How to separate the objects if there is more than one.
print("Chelsea","Liverpool", sep="-vs-")
#Specify what to print at the end. Default is '\n'
print("Hello World",end="!") 
# or use empty string "" for no new line
print("Hello World",end="")
Eugenio Carmo

Fonction d'impression dans Python

2 + 1
#Addition is done by Python, but doesn't show us the answer

print(2 - 1)
#output - 1 (This will solve and show us the answer, 2,1 and 3 all are integers)

x = 2 * 1
print(x)
#output - 2 (We have printed the varible and got the answer, all are integers)

x = 2
y = 1
print(x / y)
#output - 2.0 (When division is done answer is given as a float)

x = "2"
y = "1"
print(x + y)
#output - 21 (When two strings are added, it concatenate and the answer 
# is also a string)
Rajitha Amarasinghe

Réponses similaires à “Fonction d'impression dans Python”

Questions similaires à “Fonction d'impression dans Python”

Plus de réponses similaires à “Fonction d'impression dans Python” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code