GK SCIENTIST

General Knowledge One Stop Source
Menu
  • Home
  • Social Science
    • History
    • Political Science
    • Geography
  • Science
    • Physics
    • Chemistry
    • Biology
  • Chemistry Notes
  • Mathematics
  • Computer
  • Tutorial MySQL
  • Tutorial Python
  • Java Tutorial
  • English Grammar
  • English Essay
  • Indian Anthropology
  • Philosophy
  • Solved Paper
  • UPSC
  • Current Content
    • Current Affairs
    • RSTV News
    • Yojana and Kurukshetra Gist
  • Donate
  • Contact Us

If you are interested in advertising to our audience, submit the advertising enquiry form.

Advertising Enquiry
Computer

Python Bike Rental System (Project)

Gk Scientist December 6, 2022 No Comments
Tweet WhatsApp Telegram

Python Bike Rental System:

We can use the PyCharm code editor for this example. If you do not know about it then follow this link- How to install PyCharm for Python and create a program in it.

Code Unit:

Python Bike Rental System Code Unit - Python Bike Rental System (Project)
python bike rental system - Python Bike Rental System (Project)

Output:

Python Bike Rental System Output - Python Bike Rental System (Project)

Python Bike Rental System Source Code: Do proper Code Indentation otherwise, the Source Code does not work and gives an error.

class bike_rent_shop:
   def __init__(self,bike_stock):
       self.stock=bike_stock

   def display_bike(self):
           print("Total Bikes Availabale", self.stock)

   def rent_Bike(self, x):

       if x <= 0:
        print("Enter the Positive Value or Greater than Zero")
       elif x > self.stock:
        print("Sorry!! Required Quantity of Stock is not Availabale")
       else:
           self.stock = self.stock - x
           print("Total Prices", x * 150)
           print("Total Bikes Availabale", self.stock)

while True:
   obj=bike_rent_shop(200)
   user_choice=int(input('''
   1 Display Stocks
   2 Rent a Bike
   3 Exit
   '''))

   if user_choice == 1:
       obj.display_bike()
   elif user_choice == 2:
       y = int(input("Enter the Required Quantity:----"))
       obj.rent_Bike(y)
   else:
      break

Computer Software and Hardware
Malicious Software (Malware)
Database Management System (DBMS)
Object-Oriented Programming (OOP)
Tutorial MySQL
Tutorial Python
Python (programming language)– Wikipedia
Prev Article
Next Article

Related Articles

Python MySQL Between Operator
Python MySQL Between Operator: (1) MySQL Between Operator is a …
Gk Scientist December 16, 2022 Computer

Python MySQL Between Operator

How to Download and Install Chrome Browser on Windows
Download and Install Chrome Browser on Windows: Web Browser: A …
Gk Scientist January 29, 2023 Computer

How to Download and Install Chrome Browser on Windows

Programming Languages
Programming Languages: A programming language is a set of rules …
Gk Scientist September 8, 2022 Computer

Programming Languages

Java Nested Loops
Java Nested Loops: We can use the Eclipse IDE for …
Gk Scientist January 2, 2023 Computer

Java Nested Loops

Python SQLite Select Query
Python SQLite Select Query: We can use the PyCharm code …
Gk Scientist December 8, 2022 Computer

Python SQLite Select Query

Build Simple Calculator in Python
Build Simple Calculator in Python: We can use the PyCharm …
Gk Scientist November 24, 2022 Computer

Build Simple Calculator in Python

String Iteration in Python
String Iteration in Python: We can use the PyCharm code …
Gk Scientist November 25, 2022 Computer

String Iteration in Python

Wireless Networking
Wireless Networking: Wireless Networking facilitates data transmission through the earth’s …
Gk Scientist October 20, 2022 Computer

Wireless Networking

Leave a Reply Cancel Reply

Search

  • Popular
  • Recent




GK SCIENTIST

General Knowledge One Stop Source

Information

  • About Us
  • Terms and Condition, Disclaimer
  • Contact Us

Android Apps

  • IAS App For English Medium Students
  • IAS Basics App For English Medium Students
  • IAS Hindi App For Hindi Medium Students
DMCA.com Protection Status

Popular Tags

Biology (33) Biology Questions (88) Chemistry (57) Computer (215) Current Affairs (4) Current Content (0) Economy (15) English Essay (172) English Grammar (75) English Literature (10) Geography (83) History (259) Indian Anthropology (11) Indian Polity (14) JKAS Mains Question Papers (17) Mathematics (68) Moral Science (7) NCERT & Other Boards Books (25) Philosophy (114) Physics (89) Political Science (132) RS TV News (33) Science (553) Social Anthropology (7) Social Science (17) Solved Paper (47) UPSC (7) UPSC Mains Question Papers (26)

Downloads

  • NCERT Books
  • Old NCERT Books
  • NIOS Books For IAS, SSC, and State PSC Exam
  • Tamil Nadu Board Books: Important For UPSC, SSC, and State PSC Exam
  • Modern Indian and World History Notes For IAS Exam
  • UPSC Topper 2013 Gaurav Agrawal Notes For IAS Preparation
  • UPSC IAS Prelims General Studies – Previous Year Papers
  • UPSC Mains Question Papers

Copyright © 2023 GK SCIENTIST
Theme by MyThemeShop.com& Hosted On Cloudways

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh
 

Loading Comments...