Gladiator07 / JARVIS

Personal Voice Assistant made with Python and has a cool looking GUI
https://www.youtube.com/watch?v=oKtrHy0ERNA
MIT License
344 stars 185 forks source link

Changing The Format Of If-Else Loops To Make It More Convenient #14

Open Arnav-Singh-Legendary opened 2 years ago

Arnav-Singh-Legendary commented 2 years ago

We Can Apply This Kind (Given Below) Of Format Instead Of If-Else Loops as these are more convenient for creating conversations and I am Planning To Add A GUI Like Cortana.

It Would Be My Honor To Contribute, Please Allow Me To Contribute!

Regards Arnav Singh

            for text in Greetings1_In:
                if str(text) in Query:
                    Random_Number = Rnum(0, len(Greetings1_Out)) #Rnum Is A Function for getting A random number!
                    Speak(Greetings1_Out[Random_Number])   
                    break

            for text in Greetings2_In:
                if str(text) in Query:
                    Random_Number = Rnum(0, len(Greetings2_Out))
                    Speak(Greetings2_Out[Random_Number])   
                    break