python basic and advnacved easy tutorial.pptx

ridusingla09 13 views 8 slides Jun 11, 2024
Slide 1
Slide 1 of 8
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8

About This Presentation

python basic and advanced easy tutorial


Slide Content

PYTHON PROJECT Name-Aryan Raj SAP Id-500126035 Enrolment Number-R2142231925 School- School Of Computer Science Branch- Btech -CSE Batch-55 Submitted to-Mr Touseef Iqbal

This code is about IPL ticket booking which is implemented in Python . It allows users to select a team, choose their ticket type, select a payment method, and then generates a ticket number for them This Python code simulates an IPL ticket booking system. It allows users to: 1.View a list of available teams. 2.Select a team to watch. 3.See the stadium where the match will be played. 4.Choose a ticket type (premium, vip, or basic) based on price information provided. 5.Select a payment method from available options (PhonePay, GooglePay, NetBanking). 6.Generate a random ticket number upon successful booking. The code includes functions for: -Displaying teams -Selecting a stadium based on chosen team -Selecting a ticket type with validation -Selecting a payment method with validation -Generating a random ticket number . Description About Code

The provided code is a Python program for an IPL (Indian Premier League) Ticket Booking System. Let's break down the code and describe each component in detail. 1. Team and Stadium Information: The teams dictionary stores information about different IPL teams. Each team is represented by a key, and its corresponding value is another dictionary containing details such as the stadium where the team plays and the ticket prices for different categories (premium, VIP, basic). 2 . Payment Methods: The payment_methods list stores the available payment methods for booking tickets. 3.Helper Functions: generate_ticket_number() : This function generates a random ticket number consisting of uppercase letters and digits. display_teams() : This function displays the list of IPL teams and prompts the user to select a team. select_stadium(team): This function takes a selected team as input and prompts the user to choose a ticket type (premium, VIP, basic) for the selected team's match. select_payment_method(): This function prompts the user to select a payment method from the available options. 4.Main Functionality: The main() function serves as the entry point of the program. It starts by displaying a welcome message and the list of IPL teams using the display_teams() function. It then prompts the user to select a team by entering the corresponding number.

After selecting a team, it calls the select_stadium() function to choose the ticket type (premium, VIP, basic) for the selected team's match. Once the ticket type is selected, it displays the chosen ticket type and prompts the user to select a payment method using the select_payment_method() function. After selecting the payment method, it generates a random ticket number using the generate_ticket_number() function. Finally, it prints a confirmation message along with the generated ticket number. 5.Execution: The if __name__ == "__main__": block ensures that the main() function is executed when the script is run directly. 6.Improvement Suggestions: Error Handling: The code includes basic error handling for invalid inputs, but more comprehensive error handling could be implemented. User Experience Enhancement: Adding more user-friendly messages and a summary of booking details can improve the user experience. Modularization and Documentation: Further modularization and documentation can enhance code readability and maintainability. Consistency in Output: Ensuring consistency in the output format throughout the program can provide a better user experience. Overall, the provided code efficiently facilitates the booking of IPL tickets by guiding the user through the selection of teams, ticket types, and payment methods.

IPL Ticket Booking
Tags