Posts

Healthy Programmer

# This Is The Python Code Which Shows That What Should Be The Routine Of The Programmer To Remain Healthy. # Programmer Will Drink Water After Every 30 Minutes. # He Will Do Eyes Exercise After Every 40 Minutes. # And Also He Will Do Physical Exercise After Every 50 Minutes. from pygame import mixer import time def music (file, stopper): mixer.init() mixer.music.load(file) mixer.music.play() while True : userinput = input ( f"Enter ' { stopper } ' To Stop { file }\n " ) if userinput == stopper: mixer.music.stop() break def log (msg): with open ( "Logs.txt" , "a" ) as f: f.write( f" { msg } On { time.asctime(time.localtime(time.time())) }\n " ) if __name__ == '__main__' : initial_time_for_water = time.time() # Initial Time For Water initial_time_for_eyes = time.time() # Initial Time For Eyes initial_time_for_exercise = time.time() # Initial Time For ...

Snake Water Gun Game

  import random # Module # print ( " ** Let's Play The Game of Snake Water Gun ** " ) print () print ( "You Have Only 10 No. of Chances To Win The Game." ) print () no_of_chances = 10 userscore = 0 computerscore = 0 try : while no_of_chances > 0 : user_input = input ( "Press \n 'S' For Snake \n 'G' For Gun \n 'W' For Water \n UserInput - " ) computer_input = random.choice( "SWG" ) # Computer Will Randomly Select Any Character From "SWG" # if user_input == computer_input: print ( " \n The Match Is Tied , Each Gets One Point." ) userscore = userscore + 1 print ( "Your Score =" , userscore) computerscore = computerscore + 1 print ( "Computer Score =" , computerscore) elif user_input == "S" and computer_input == "W" : pri...