Namozov Nodirbek niyozovich
cost=int(input("summani kiriting= " ))
Download 0.88 Mb.
|
Dars Mashg\'uloti if-elif-else
- Bu sahifa navigatsiya:
- Random-TASODIFIY randint-tasodifiy haqiqiy son
cost=int(input("summani kiriting= " ))Aksiya doirasida if elif else funksiyasini qo’llab dastur tuzaylik
Random-TASODIFIY randint-tasodifiy haqiqiy sonB o'zgaruvchisi raqamlarni o'z ichiga olmaydi, shuning uchun uni taqqoslash mumkin emas. b=print(random. randint(1, 10)) ------> bunday holda, faqat ekranda chiqish jarayoni bo'ladi, lekin tayinlanmaydi import random b=print(random.randint(1,10)) a=int(input()) if b==a: print("siz yutdingiz") else: print("siz yutkazdingiz") Siz = input("Dars o'tishimni Xoxlaysizmi: ") if Siz == "Ha": print("Ismingiz nima ") elif Siz == “ha": print("Ismingiz nima ") else: print("Unda nimaga kelding") a = input(“Ismingizni kiriting: ") b = “Dasturchi! " if a == "Nodirshox": print("Assalomu alaykum,", b) else: print("Assalomu alaykum,", a, end="!") Darsimizga oid misollar https://www.programiz.com/python-programming/if-elif-elsevar1 = 1+2jvar1 = 1+2jif (type(var1) == int):print("Type of the variable is Integer")elif (type(var1) == float):print("Type of the variable is Float")elif (type(var1) == complex):print("Type of the variable is Complex")elif (type(var1) == bool):print("Type of the variable is Bool")elif (type(var1) == str):print("Type of the variable is String")elif (type(var1) == tuple):print("Type of the variable is Tuple")elif (type(var1) == dict):print("Type of the variable is Dictionaries")elif (type(var1) == list):print("Type of the variable is List")else:https://www.w3resource.com/python/python-if-else-statements.php Download 0.88 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling