“Fungsi cetak di Python” Kode Jawaban

Cetak 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

cara menggunakan fungsi cetak dalam 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

Cetak di Python

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

Fungsi cetak di Python

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

Fungsi cetak di 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

Fungsi cetak di 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

Jawaban yang mirip dengan “Fungsi cetak di Python”

Pertanyaan yang mirip dengan “Fungsi cetak di Python”

Lebih banyak jawaban terkait untuk “Fungsi cetak di Python” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya