Darvozaning eni metr, bo‘yi esa metr: #1) darvoza yuzasi (S)ni hisoblash dasturini tuzing


Download 40.09 Kb.
bet7/10
Sana30.04.2023
Hajmi40.09 Kb.
#1408293
1   2   3   4   5   6   7   8   9   10
Bog'liq
9-sinf inf


a=int(input('a=')) b=a%10

print("siz kiritgan ",a," sonining oxirgi raqami-",b)
input()
#52 dars 3-mashq

#3.Sutkaning n sekundi berilgan. Sutka boshlanganidan #beri qancha soat (h), minut (min) va sekund (s)
#o‘tganini aniqlash dasturini tuzing.
#masalan, n = 13257 = 3*3600 + 40*60 + 57; h = 3 va min = 40.

print('Izoh: 86400 sekund bir sutka, a sekundni kiriting') a=int(input('a='))

s=a%60 #sekund ok=a//60 #oraliq kattalik min=ok%60 #min h=ok//60
print(a, 'sekund-',h,'soat',min,'min',s,'sekund') input()
#52 dars 4-mashq
#4.Mahsulotning narxi s so‘m. Ushbu mahsulotdan n ta sotib #olish uchun qancha so‘m sarflash kerak?
print('Mahsulot narxi s ni kiriting') s=int(input('s='))

print('Xarid miqdotini kiriting-') n=int(input('n='))
M=s*n
print('kerakli pul-',M,' so`m') input()

#52 dars 5-mashq


#5.Musbat butun son berilgan. Ushbu sonning o‘nliklar xonasidagi #raqamini aniqlash dasturini tuzing.

print('Musbat sonni kiriting') a=int(input('a='))

if a>0:

b=a//10 c=b%10

print('Sonning o`nli raqami-',c) input()
#52 dars 6-mashq
#6.Ismingizni kiritganda quyidagi xabarni chiqaruvchi dasturni #tuzing. Dastur tuzishda print() operatorining end() usulidan #foydalaning.
#Kiruvchi ma’lumot Chiquvchi ma’lumot #Lola Xush kelibsiz, Lola!

print('Ismingizni kiriting-') a=input('a=')
print('Hush kelibsiz, ',a,'!')
#53-dars 1-misol
#1.0 dan 20 gacha bo‘lgan juft sonlarni ekranga #chiqaruvchi dastur tuzing.

n=0

while n<=20: print(n) n+=2

input()

#53-dars 2-misol
#2. n va k butun manfiy bo‘lmagan sonlar berilgan. #n va k qatnashgan ushbu ifodani hisoblang.

from math import* n=int(input('n=')) k=int(input("n>k="))

Download 40.09 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling