Posts

Showing posts from June, 2023

TRANSLATE A WEBSITE INTO OTHER LANGUAGE-

 HOW TO IMPLEMENT A WEBSITE USING JAVASCRIPT SOURCE CODE- TRANSLATE A WEBSITE INTO OTHER LANGUAGE- ADD GOOGLE TRANSLATE IN YOUR WEBSITE USING JAVASCRIPT SOURCE CODE   < div id = "google_translate_element" ></ div >                   < script src = "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" ></ script >                   < script >                       function googleTranslateElementInit (){                         new google . translate . TranslateElement (                           { pagelanguage : 'en' },                           'google_translate_element'                         );                       }                   </ script ></ nav >

Creating an animated tree using Python can be a fun project

  Creating an animated tree using Python can be a fun project source code import turtle def draw_tree ( branch_len , t ):     if branch_len < 5 :         return     t .forward( branch_len )     t .right( 20 )     draw_tree ( branch_len - 15 , t )     t .left( 40 )     draw_tree ( branch_len - 15 , t )     t .right( 20 )     t .backward( branch_len ) def main ():     t = turtle . Turtle ()     screen = turtle . Screen ()     screen . setup ( 800 , 600 )     screen . bgcolor ( "black" )     t . speed ( 0 )   # Set the drawing speed (0 is the fastest)     t . left ( 90 )     t . up ()     t . backward ( 200 )     t . down ()     t . color ( "green" )     draw_tree ( 100 , t )     screen . exitonclick () if __name__ == "__main__" :     main ()

an age calculation app using python

  an age calculation app python source code import datetime def calculate_age ( birth_year ):     current_year = datetime . datetime . now (). year     age = current_year - birth_year     return age def process_input ( user_input ):     try :         birth_year = int ( user_input )         age = calculate_age ( birth_year )         response = f "You are approximately { age } years old."     except ValueError :         response = "Invalid input. Please enter a valid birth year."     return response print ( "Welcome to the Age Calculation App!" ) while True :     user_input = input ( "Enter your birth year (or 'exit' to quit): " )         if user_input . lower () == "exit" :         break     response = process_input ( user_input )     print ( response ) print ( "Thank you for using the Age Calculation App!" )