Posts

Showing posts from March, 2021

Grab latest technology news by just writing nine lines of code in "Python"!

Image
I n today's era who would don't like to learn about technology? .The latest trending hot topics like Machine learning, Data Science, Big data,  and  Data visualization. these are such technologies that are taking the world to the next level.  The person who might be reading this may be a computer nerd or expert or a student like me. So to be updated we must read the treading topics of upcoming updates and technology But I know you very well!. Going to the website or reading articles or even in-shorts sounds troublesome. So the best and fun solution is that we can read the news programmatically. To do this I have used the requests module and JSON module Here the major part is to get the API key by creating an account on the  news API website . requests. get(URL) -- it visits the provided URL and collects the HTML content of the web page brings it in the python code. But we need the title from the news  So to do that, I have used JSON built-in function JSON.l...

Grab repeated Strings from any given sentences

Image
  Code: For extracting repeated string occurrences def   Occurrences ( string ):     word= "Microsoft"     letters={words  for  words  in  string  if  words  in  word.lower()}        print ( f " { '' .join(letters).upper() } \n Repeated letters:  { len (letters) } " ) Occurrences( input ( "Enter the letters " ))

Generate a Bill receipt using Python

Image
   Code for The receipt generator:  rate= 0 while   True :      try :         amount= input ( "Enter the rate " )          if  amount== "q" :              with   open ( "Bill.txt" , "a" )  as  files:                 files.write( f "Bill: { rate } \n " )                  break          else :             rate=rate+ int (amount)      except :          print ( "Please enter a valid input" )