DEV Community

Arman Idrisi
Arman Idrisi

Posted on

Python Project - How To Create A Quote Generator In Python

Python is a versatile programming language that can be used to build a wide range of projects, from small scripts to large-scale applications. If you're new to Python, starting with a small project is a great way to get hands-on experience with the language and learn its core concepts. In this post, we'll explore the simple python project which can generate the random quotes.

Get Started

Installation

In Your Terminal

pip install pyquotegen
Enter fullscreen mode Exit fullscreen mode

import module in your project

import pyquotegen
Enter fullscreen mode Exit fullscreen mode

Code For Get A Single Quote

q=pyquotegen.get_quote()
print(q)
Enter fullscreen mode Exit fullscreen mode

Code For Get The Quote By Category

pyquotegen.get_quote("motivational") #it will give you a random quote on motivational category
Enter fullscreen mode Exit fullscreen mode

Creating A Full Project Which Can Take Category From Input And Gives The Quote.

#import module
import pyquotegen

#gets the category from user input 
c = input("Enter The Category: ")

#Get The Quote
q=pyquotegen.get_quote(c)
print(q)
Enter fullscreen mode Exit fullscreen mode

Check More About Pyquotegen On Github Click Here

Please Star Us On Github

Thanks For Reading

Top comments (0)