التخطي إلى المحتوى الرئيسي

المشاركات

عرض الرسائل ذات التصنيف Python Program

Create OM NAMAH SHIVAY JAP MANTRA based application using Python

 Create OM NAMAH SHIVAY JAP MANTRA based application using Python This application require, pyttsx3 based library to convert text to speech. install pip install pyttsx3  write this code. import time import pyttsx3   engine = pyttsx3.init() engine.setProperty('rate', 150)  # Speed of speech (words per minute) engine.setProperty('volume', 0.8)  # Volume (0.0 to 1.0) count=1 while True:     print("OM NAMAH SHIVAY")     engine.say("OM NAM AH SHIV AY ")     engine.runAndWait()     time.sleep(2)     print(count)     count=count+1     if count>10:         break

Create Lift based program using Python?

1) Create a Lift Operation-based program using Python? Q) You have one five-floor building and the lift will be shifted from 1 st floor to the fifth floor and the fifth floor to the first floor. 1)  program solution using While Loop? import time i=1 while i<=10:     if i<=5:         print("lift is on >  floor no is ",i)         time.sleep(5)     else:         print("lift is on < foor no is ",11-i)         time.sleep(5)     i=i+1     2)  Is this program explanation using for loop? import time i=1 for i in range(1,11):     if i<=5:         print("lift is on >  floor no is ",i)         time.sleep(5)     else:         print("lift is on < floor no is ",11-i)         time.sleep(5) Lift Program import time import pyttsx3  ...