👇Get a joke
Click the "get joke" button
Pyjokes - is a python library / module for one line joke program based on programmers. You can get funny one-liner random jokes at every run also available in following "languages" & "categories".
Supported Languages By Pyjokes
- English — ‘en’
- Spanish — ‘es’
- Italian — ‘it’
- German — ‘de’
- Galician — ‘gl’
- Basque — ‘eu’
Categories Included In Pyjokes
- For geeky jokes -’neutral’ (It is chosen by default)
- For Chris Norris Jokes — ‘chuck’.
- If you want all type of jokes — ‘all’
- There
is one more category known as ‘twister’ which only works for the German
Language (‘de’) and mostly includes tongue twister.
Read the documentation available on https://pyjok.es for more info.
:::Lets Code:::
Install pyjokes if you haven't
pip install pyjokes
This Program will give you one-liner Joke
#pip install pyjokes # importing module import pyjokes # we want joke in english so 'en', category = all joke = pyjokes.get_joke(language='en', category= 'all') #display a joke print(joke)
This Program will give do the same but only difference is we have changed the catagory
# importing module import pyjokes # we want joke in english so 'en', changing category to neutral joke = pyjokes.get_joke(language='en', category= 'neutral') #display a joke print(joke)
This Program will give you multiple jokes all at once depends on you number range
# importing module import pyjokes # we want joke in english so 'en', category neutral jokes = pyjokes.get_jokes(language='en', category= 'neutral') # we want some jokes atleast 5 one after another for i in range(5): print(i+1,".",jokes[i])
Enjoy!!!
Comments
Post a Comment