Python Tutorials

Python Project – Restaurant Billing System 0

Python Project – Restaurant Billing System

SQL Queries CREATE DATABASE restaurant_db; USE restaurant_db; CREATE TABLE customers ( customer_id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), contact VARCHAR(15) ); CREATE TABLE menu_items ( item_id INT AUTO_INCREMENT PRIMARY KEY, item_name VARCHAR(100), price DECIMAL(10,2)...

Python Project – Countdown Timer 0

Python Project – Countdown Timer

Program 1 #CountDown Project import time def countdown(t): print(“\t\t”) while(t): mins,secs=divmod(t,60) timer = f'{mins:02d}:{secs:02d}’ print(timer,end=”\r”) time.sleep(1) t=t-1 print(“Time’s up!”) # Main Calling seconds = int(input(“Enter time in seconds: “)) countdown(seconds)  

To Do List using Python 0

To Do List using Python

Program 1 # To Do List Project mytasks=[] def show_tasks(): if(mytasks): print(“\nYour To-Do List:”) for index, task in enumerate(mytasks, 1): print(f”{index}. {task}”) else: print(“\nYour To-Do List is empty.”) def to_do_list(): while(True): print(“————-To Do List—————–“)...

Flash Card App using Python 0

Flash Card App using Python

Program 1 def flash_card_app(): flashcards ={ “What is the capital of India?”: “Delhi”, “What is 10 + 10?”: “20”, “Who wrote ‘Harry Potter’?”: “J.K. Rowling”, “Where is Taj Mahal ?”: “Agra”, “Python is …………?”:...

Simple Calculator in Python 0

Simple Calculator in Python

Program 1 # Simple Calculator using menu #function for addition def add(x,y): return(x+y) #function for subtraction def sub(x,y): return(x-y) #function for multiplcation def multiply(x,y): return(x*y) #function for division def div(x,y): return(x/y) # Main calling...

Rock Paper Scissors Game in Python 0

Rock Paper Scissors Game in Python

Program 1 # Rock Scissors and Paper Game import random # Function to pick value from computer def get_comp_choice(): return(random.choice([‘rock’,’paper’,’scissors’])) # Function to pick value from user def get_user_choice(): choice=input(“Enter your choice(‘rock’,’paper’,’scissors’)”).lower() while choice...

Number Guessing Game using Python 0

Number Guessing Game using Python

Program 1 # Guess Number Game import random def guess_number(): comp_choice=random.randint(1,100) print(“———–Guess Number Game—————“) print(“Enter your guess(1-100) and if you guess in 5 attempts You are Winner !”) count=5 i=0 while(True): count-=1 i=i+1 user_choice=int(input(“Enter...

Python Project – Countdown Timer 0

Python Project – Countdown Timer

Program 1 # CountDown Application import time def countdown(t): while(t): mins,secs=divmod(t,60) timer = f'{mins:02d}:{secs:02d}’ print(timer,end=”\r”) time.sleep(1) t=t-1 print(“Time’s up!”) # Main calling seconds=int(input(“Enter time in seconds: “)) countdown(seconds)  

Python Project – Flash Card App 0

Python Project – Flash Card App

Program 1 #Flash Card App Project def flash_card_app(): flashcards ={ “What is the capital of India?”: “Delhi”, “What is 10 + 10?”: “20”, “Who wrote ‘Harry Potter’?”: “J.K. Rowling”, “Where is Taj Mahal ?”:...