Create a A.I Jokes using python programming language | CodeHub

MNC Answers
0

  In this post we will learn about How Create a A.I Jokes using python programming using 8 lines of  Python Programming language . In this program we using "pyttsx3 " and "pyjokes" package.


Create a A.I Jokes using python programming language | CodeHub



Packages required:

To build a personal voice assistant it’s necessary to install the following packages in your system using the pip command.

1) pyttsx3 — pyttxs3 is a text to speech conversion library in python. This package supports text to speech engines on Mac os x, Windows and on Linux.


How to install pyttsx3:

Note :    we need to install pyttsx3 library using pip install in cmd in command prompt  

        Example : "pip install pyttsx3"


How to create a AI voice assistant using 8 lines of Python Programming language | CodeHub


2) pyjokes: One line jokes for programmers (jokes as a service). Installation. Install the pyjokes module with pip

How to install pyjokes:


Note :    we need to install pyjokes library using pip install in cmd in command prompt  

        Example : "pip install pyjokes"


3)  Execute the below code in any python compiler 


Source code:

import pyjokes, pyttsx3


temp=pyttsx3.init()


joke = pyjokes.get_joke()


print(joke)


temp.say(joke)


temp.runAndWait() (code-box)


Video output: 

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
Youtube Channel Image
MM4Tech Subscribe To watch more Tutorials
Subscribe