Python with MIT | Learn Python
10 subscribers
1 file
6 links
Download Telegram
Channel photo removed
Channel photo updated
a = input()
b = input()
d = 0; c = ""
if len(a) < len(b):
a = a.zfill(len(b))
elif len(a) > len(b):
b = b.zfill(len(a))
a = a[::-1]; b = b[::-1]
for i in range(len(b)):
d += int(a[i]) + int(b[i])
c += str(d % 10)
d // = 10
if d:
c += str(d)
print(c[::-1])
else: print(c[::-1])
πŸ”₯2
1 -kod:
import sys
sys.stdin = open("input.txt", "r")
sys.stdout = open("output.txt", "w")
a, b = map(int, input().split())
print(a ^ b)
2 - kod:
import sys
sys.stdin = open("input.txt", "r")
sys.stdout = open("output.txt", "w")
a, b = map(int, input().split())
print(a + b)
πŸ”₯1
Bugungi darsimiz: for sikli 🐍

for β€” bir amalni bir necha marta bajarish uchun ishlatiladi.
πŸ‘Ž1
for i in range(1, 6):
print(i)
πŸ”₯1
πŸ“Œ Natija:
1
2
3
4
5
πŸ”₯1
🧠 Tushuntirish:
range(1, 6) β†’ 1 dan 5 gacha
i β†’ har aylanishda oβ€˜zgaradi
πŸ”₯1
2️⃣ Misol: matnni 3 marta chiqarish
for i in range(3):
print("Salom")
πŸ“Œ Natija:
Salom
Salom
Salom
πŸ“ Vazifa:
for yordamida 1 dan 10 gacha
boβ€˜lgan sonlarni chiqaring.
Channel name was changed to Β«Python with MIT | Learn PythonΒ»
🐍 Bugungi dars: while sikli

while β€” shart toβ€˜gβ€˜ri boβ€˜lsa,
kod qayta-qayta ishlaydi.
i = 1

while i <= 5:
print(i)
i += 1
πŸ“Œ Natija:
1
2
3
4
5