write a program that generate 7 random number in the form of list from one ab to 9.
from the comments
#in the form of list
import random
def easy():
lis = []
i = 0
while i < 7:
lis.append(random.randint(1,9))
i+=1
print(lis)
easy()
#in the form of list
import random
def easy():
lis = []
i = 0
while i < 7:
lis.append(random.randint(1,9))
i+=1
print(lis)
easy()
write a program that count number of odd number in the given number.
example:- input=3687 .#output=2
example:- input=3687 .#output=2
Leetcode with dani
write a program that count number of odd number in the given number. example:- input=3687 .#output=2
n=int(input('number:'))
num=0
if n < 0:
n=-n
while n > 0:
no=n%10
if no % 2 != 0:
num+=1
n=n//10
print(num)
num=0
if n < 0:
n=-n
while n > 0:
no=n%10
if no % 2 != 0:
num+=1
n=n//10
print(num)
👍3
❤🔥3👎2
Anonymous Quiz
13%
(3,2,3)
53%
(3,(2,3))
15%
(T1,2,3)
18%
error
kemejemria jmro python memar mefelgu sewoch ke first message gemrachu mayet techlalachu keza betechemari be mangnawm seat erdata kefelegachu conatct argugn https://news.1rj.ru/str/zprogramming_bot
❤🔥7
🇪🇹Ethio Apps Store 📀
Python_4.2.21_Pro.apk
be slk lemetemaru kesr yalwn tetekemu yelayegnaw kalseralachu
Forwarded from Leetcode with dani
Pydroid 3_6.4_arm_premium.apk
53.5 MB
https://news.1rj.ru/str/+m835nLa3A0c2MjBk groupun yaltekelakelachu join argu
Telegram
leetcoders
You’ve been invited to join this group on Telegram.
#code_challenge write a code for a Given a string containing just the characters '(', ')', '{', '}', '[', and ']', determine if the input string is valid. An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order
you can submit your answers via https://news.1rj.ru/str/zprogramming_bot
Forwarded from Dani
አትጠይቅ (?)
"አትመርምር ፣ አትጠይቅ ፣
ልብህ ቢያስብ እንኳን ፣ ምላስህን ጠብቅ፣
"ዝም በል" የሚሉት ቃል ፦
ተመራምሮ ላየው ፣ ብዙ ያስጠይቃል ።
ሲጀመር ፦
አስተዋይ አዋቂ ፣ ጠያቂ...አዕምሮ፣
ከነፍስ ባህርይ፣ በሥጋ አንጎል ቋጥሮ፣
አምላክ ከፈጠረ
ስለምን ዝም ይበል፣ የተመራመረ ?
ሲቀጥል ፦
ልብ የጠየቀውን ፣ አንደበት አውጥቶ ስላልተናገረ፣
የልብብ ሚያውቅ አምላክ፣ እንዳልተጠየቀ እንዴት ተቆጠረ?
ባጭሩ ፦
የሰነፍ አንደበት ፣ ለመልስ ሲቸግረው፣
መርማሪ አዕምሮን፣ "በአትጠይቅ" አሰረው ።
✍ መላኩ አላምረው
"አትመርምር ፣ አትጠይቅ ፣
ልብህ ቢያስብ እንኳን ፣ ምላስህን ጠብቅ፣
"ዝም በል" የሚሉት ቃል ፦
ተመራምሮ ላየው ፣ ብዙ ያስጠይቃል ።
ሲጀመር ፦
አስተዋይ አዋቂ ፣ ጠያቂ...አዕምሮ፣
ከነፍስ ባህርይ፣ በሥጋ አንጎል ቋጥሮ፣
አምላክ ከፈጠረ
ስለምን ዝም ይበል፣ የተመራመረ ?
ሲቀጥል ፦
ልብ የጠየቀውን ፣ አንደበት አውጥቶ ስላልተናገረ፣
የልብብ ሚያውቅ አምላክ፣ እንዳልተጠየቀ እንዴት ተቆጠረ?
ባጭሩ ፦
የሰነፍ አንደበት ፣ ለመልስ ሲቸግረው፣
መርማሪ አዕምሮን፣ "በአትጠይቅ" አሰረው ።
✍ መላኩ አላምረው
❤5🔥1
#code_challenge write a code that find the longest common prefix in the Given two strings.
Forwarded from K
def bracket_validator(s):
bracket_stack = []
char_tree = ["{([","})]"]
cor = {"}":"{","]":"[",")":"("}
for i in s:
if i in char_tree[0]:
bracket_stack.append(i)
elif i in char_tree[1]:
bracket_stack.pop() if cor[str(i)] == bracket_stack[-1] else False
return False if bracket_stack else True
bracket_stack = []
char_tree = ["{([","})]"]
cor = {"}":"{","]":"[",")":"("}
for i in s:
if i in char_tree[0]:
bracket_stack.append(i)
elif i in char_tree[1]:
bracket_stack.pop() if cor[str(i)] == bracket_stack[-1] else False
return False if bracket_stack else True