Posts

Showing posts with the label TIME CONVERSION PROGRAM

PROGRAM TO CONVERT 12HOURS CLOCK TIME INTO 24HOURS CLOCK

  def  timeConversion(s):     if  s[ 0 : 2 ] ==  "12"   and  s[- 2 :] ==  "AM" :         print( "00" +s[ 2 : 8 ])      elif  s ==  "12:00:00AM" :         print( "00:00:00" )      elif  s[ 0 : 2 ] ==  "12"   and  s[ 7 : 9 ] ==  "PM" :         print(s[ 0 : 7 ])      elif  s[- 2 :] ==  "PM"   and  s[ 0 : 2 ] !=  "12" :         print( f " {int(s[: 2 ])+ 12 }{s[ 2 : 8 ]} " )      elif  s[ 0 : 2 ] ==  "24" :         print( "THIS TIME IS ALREADY AS 24 HOURS CLOCK" )      else :      ...

SENDING MESSAGE USING G-MAIL BY PYTHON

import  smtplib # Calling SMTP s = smtplib.SMTP( 'smtp.gmail.com' ,  587 ) # TLS for network security s.starttls() # User email Authentication s.login( "YOUR GMAIL ID..." ,  password = "your pass" ) # message to be sent message =  input ( "Enter Your message Here: " ) # sending the mail s.sendmail( "YOUR G-MAIL ID" ,  "TO WHOME WE ARE SENDING MESSAGE THE RECIEVER G-MAIL ID" ,                 msg =message)