Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions python/Akhbar padhke sunao.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import json
import requests

def speak(str):
from win32com.client import Dispatch
speak = Dispatch("SAPI.SpVoice")
speak.Speak(str)

# speak("News for today")

if __name__=='__main__':
# speak("News for today")
url="http://newsapi.org/v2/top-headlines?country=in&apiKey=47c2ca33ecd24419b753c88a9df9330d"
r=requests.get(url).text
# print(r)
data=json.loads(r)
print(data["articles"])
arts=(data["articles"])
# for article in arts:
# speak(article['title'])
# speak("Next news is")
for i in arts:
speak(i["title"])
speak("Next news is")

29 changes: 29 additions & 0 deletions python/Know Your age in 2090.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
while(True):
i=int(input("Enter your age or Birth Year(YYYY): "))

if(len(str(i))==4):
if(1920<=i<=2021):
print("Your age in 2090 will be ",(2090-i))

elif(i>2022):
print("You are not born yet !")

else:
print("You seem to be the oldest person alive")

else:
if(0<=i<=120):
print("Your age in 2090 will be ",(2090-(2021-i)))
elif(i<0):
print("You are not born yet")
else:
print("You seem to be oldest person alive.")

# print("Do you want to continue? 1 or 0")
# ch=input()
# if ch==1:
# continue
# else:
# break

pr
21 changes: 21 additions & 0 deletions python/The next palindrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def rev_item(p):
rem=0
num=0
while p>0:
rem=(rem*10)+(p%10)
num=rem
p=p//10
return(num)

n=int(input("Number of test cases you want: "))
for i in range(n):
t=int(input("Enter a number:"))
if t==rev_item(t):
print(f"{t} itself is a palindrome")
else:
for i in range(t+1,t+100):

if (rev_item(i)==i):
print(f"Next palindrome of {t} is {rev_item(i)}")
break
exit()