Naren, Harish CS Project
Naren, Harish CS Project
Naren, Harish CS Project
HISTORY OF PYTHON
1989: Guido van Rossum begins working on Python.
Why Python?
Easy to learn
Python is considered to be simple to learn and master, and beginners
can build a basic game in a few days.
Versatile
Python is platform-independent and can be used for a variety of
purposes, including automation, machine learning, and data science.
Supportive community
Python has a large and supportive community, with many libraries
and frameworks available
.
Used by many companies
Python is used by many companies and institutions around the
world.
Disadvantages of Python:
Slow execution speed: Python is an interpreted language, which means
it's slower than compiled languages like C or Java. This is because Python
translates code into machine code line by line during execution.
Not ideal for mobile and game development: Python is mainly used for
desktop and web server-side development. It's not considered ideal for
mobile app and game development due to its slow processing speed and
high memory consumption.
Less secure: Python is a dynamically typed language, which can lead to
vulnerabilities.
Overview of Mysql
What is SQL?
Structured query language (SQL) is a programming language for storing and
processing information in a relational database. A relational database stores
information in tabular form, with rows and columns representing different
data attributes and the various relationships between the data values.
Why SQL?
database.
Insert data: Add new data to the database.
NOT NULL
UNIQUE
DEFAULT
PRIMARY KEY
FOREIGN KEY
Key Concepts:
Relational Databases:
SQL Statements:
SELECT: Retrieves data from one or more tables.
ABSTRACT
REQUIREMENTS
SOURCE CODE
class Movie:
def __init__(self, title, duration, rating, total_seats):
self.title = title
self.duration = duration
self.rating = rating
self.total_seats = total_seats
self.available_seats = total_seats
def __str__(self):
return f"{self.title} | Duration: {self.duration} min | Rating:
{self.rating}/10 | Available Seats: {self.available_seats}"
class User:
def __init__(self, name, age):
self.name = name
self.age = age
self.bookings = []
def show_bookings(self):
if not self.bookings:
return "No bookings found."
return "\n".join([f"{title}: {num_tickets} tickets" for title,
num_tickets in self.bookings])
class MovieBookingSystem:
def __init__(self):
self.movies = []
self.users = []
def show_movies(self):
return "\n".join([str(movie) for movie in self.movies])
while True:
print("\n1. Show Movies")
print("2. Register User")
print("3. Book Ticket")
print("4. Show User Bookings")
print("5. Exit")
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()
OUTPUT