“Druckfunktion in Python” Code-Antworten

Python -Druck

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

So verwenden Sie die Druckfunktion in 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

Drucken in Python

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

Druckfunktion in Python

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

Druckfunktion in 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

Druckfunktion in 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

Ähnliche Antworten wie “Druckfunktion in Python”

Fragen ähnlich wie “Druckfunktion in Python”

Weitere verwandte Antworten zu “Druckfunktion in Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen