Posts

Showing posts from December, 2020

Print string with any combination

  from   itertools   import   permutations   str = "abcdefghijklmnopqrstuvwxyz" y = int ( input ( "Enter range of letters of alphabet =" )) your_str = str [ 0 : y ] print ( "You entered  =" ,  your_str )  m = int ( input ( "How many string do you want? =" )) r = int ( input ( "Enter range of letters Combination =" )) permutation  = [ '' . join ( x )  for   x   in   permutations ( your_str , r )]  x = tuple ( permutation ) print ( ', ' . join ( x [ 0 : m ]))

Jarvis voice

  import  pyttsx3 engine  =  pyttsx3 .init() voices = engine .getProperty( 'voices' ) engine .setProperty( 'voice' ,  voices [ 1 ].id) engine .setProperty( 'rate' ,  125 ) engine .setProperty( 'volume' , 0.2 ) engine .say( "Hello, How are you?" ) engine .save_to_file( 'Hello World' ,  'test.mp3' )  engine .runAndWait()