Print() - funksiyasi xaqida .

mohimbegim20

moxi3017

Posted on March 23, 2023

Print() - funksiyasi xaqida .

Assalamu aleykum xurmatli dasturchi bugun siz bn Python dasturlash tilida Print funksiyasini ko'rib chiqamiz. Print- bu Pythondagi mahsus funksiya bo'lib ,() ichida berilgan matn yoki ifodalarni ekranga (konsolga) chiqarib beradi.

Misol uchun

print("Hello World")
print("Assalamu alaykum")
print("Salom Dunyo")
Enter fullscreen mode Exit fullscreen mode
Hello World 
Assalamu aleykum
Salom dunyo
Enter fullscreen mode Exit fullscreen mode

print(Hayirli tong!)

Natija : SyntaxError : invalid syntax

Bu safar esa Hayrli tong ! yozuvi o'rniga , Sytax Error (sinteksda xatolik)xabar chiqadi . Xatolik qayerda ?

Avval aytdganimizdek , print()funksiyasi matn yoki ifodalarni konsolga chiqarish vazifasini bajaradi . Lekin bu funksiya to'g'ri ishlashi uchun bir nechta qoidalarga amal qilish lozim . Jumladan ,agar konsolga matn chiqarmoqchi bo'lsak motnimiz albata qo'shtirnoq yoki birtirnoq ichida bo'lishi kk. Demak Hayirli tomg ! so'zini konsolga chiqarirish uch to'g'ri kod :

print("Hayirli tong !")
print('Hayirli tong')
print("Biz Pythinda dasturlash tilinio'rganishni boshladik ")
print('Biz Python dasturlash tili judayam qiziq ekan')
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
mohimbegim20
moxi3017

Posted on March 23, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related