Python Basics
Python Basics
CONDITIONS :
IF TIME IS ( 6 TO 12 ) THEN GOOD MORNING
IF TIME IS (12 TO 4) GOOD AFTERNOON
IF TIME IS > 4 GOOD EVENING.
CONDITIONS:
IF AGE IS BELOW 3 THEN NO TICKET PRICE WILL TAKEN
IF AGE IS BETWEEN 4 TO 12 THEN DISCOUNT RATE IS 10%
IF AGE IS ABOVE THE 12 THEN DISCOUNT RATE IS 5%.
5. CREATE PROGRAM WHICH WILL CLASSIFY THE AGE BASED ON THE AGE
GIVEN BY USER
CONDITIONS :
username
email
password
confirm password
-----------------------------------------------------------------------------------------------------------
Create new python project:
Django project: University
Django app: College
Superuser: username: Principal| password: Principal@123
Username: BCAhead
Password: BCA@head
Username: BCOMhead
Password: BCOM@head
✅ ✅ ❌
Username active staff superuser extra
✅ ✅ ✅
BCAhead Can view users
BCOMhead -
project name : task
django project : flipkart
django app1 : userapp
django app2 : flipkartapp
django app3 : deliveryboy
✅ ✅ ❌
Username active staff superuser extra
✅ ✅ ❌
gaurav -
aman -
LIST TASKS :
Collegedetail
name
address
phone
established_year
city
Coursedetail
name
duration
seats
fees
Dictionary tasks : click me
Exercise 4 :
authors = {
"F. Scott Fitzgerald": ["The Great Gatsby", "Tender Is the Night", "The Beautiful and
Damned"],
"Harper Lee": ["To Kill a Mockingbird", "Go Set a Watchman", "To Kill a Mockingbird: 50th
Anniversary Edition"],
"George Orwell": ["1984", "Animal Farm", "Homage to Catalonia"],
"Jane Austen": ["Pride and Prejudice", "Sense and Sensibility", "Emma"],
"J.D. Salinger": ["The Catcher in the Rye", "Franny and Zooey", "Nine Stories"],
"J.K. Rowling": ["Harry Potter and the Philosopher's Stone", "Harry Potter and the Chamber of
Secrets", "Harry Potter and the Prisoner of Azkaban", "Harry Potter and the Goblet of Fire"],
"Agatha Christie": ["Murder on the Orient Express", "The Murder at the Vicarage", "The ABC
Murders", "Death on the Nile"]
}
Print All Books by a George Orwell Author with the Author name
// output:- Author:- George Orwell Books:- 1984, Animal Farm, Homage to Catalonia
Check if an Author J.K. Rowling Exists in the Collection if present the write present else not
present
Cartable
Model
Year
Price
Available BooleanField
Description
Storetable
Name
Address
Phone Number
Purchasetable
Customer Name
Price Paid
Model Practice Task :
First.html
Second.html
Third.html
Forth.html
Five.html
Every page must have one image. Each page should be linked with the
previous and next page.
1. Home Page
2. Event Page
3. Create Event Page
4. Event Categories Page
5. Contact Page
1. For addition
2. For subtraction
3. For division
4. For multiplication
5. For exit
After loading the template perform form to variable for the form.
Download Following Form and perform form to variable:
https://drive.google.com/file/d/1CFu7AEq4MftZwkYaiopm_-0SNCjbGR
5D/view?usp=sharing
Booking Form
https://drive.google.com/file/d/14sIO0ySZolnX7m3EODEia
pvQ9GHXgWI0/view?usp=sharing
Perform Form To Variable On following form and
print to another page.
https://drive.google.com/file/d/1nynohO2yS7Uh5
pv08D-du5nfM2ZmBjQg/view?usp=sharing
index.html
Register The User From Following Registration
Form :
https://drive.google.com/file/d/1YVj9DSk5XPkZU
PwBHjC7jOSfyAag7otq/view?usp=sharing
https://drive.google.com/file/d/1JkC8e26jYsZFqy
zmXK7iiTCiTfjM43IH/view?usp=sharing
https://drive.google.com/file/d/1O_uN0jzKOgebSEUuI861
ngQsyx4A1jNL/view?usp=sharing
Dictionary tasks:
https://api.dictionaryapi.dev/api/v2/entries/en/hello
Topics :
1) How to fetch data from api and use that data into the html
template ?
ans.
ISRO API:
https://isro.vercel.app/api/spacecrafts
BITCOIN API :
https://api.coindesk.com/v1/bpi/currentprice.json
RTO API:
url = "https://indian-rtos-names-search.p.rapidapi.com/rtos"
headers = {
"x-rapidapi-key":
"d1cdc518d8mshf21c5dc9e4b20c4p11ad42jsn8a083e29935a",
"x-rapidapi-host": "indian-rtos-names-search.p.rapidapi.com"
}
response = requests.get(url, headers=headers)
https://rest-countries10.p.rapidapi.com/countries
headers = {
"x-rapidapi-key":
"d1cdc518d8mshf21c5dc9e4b20c4p11ad42jsn8a083e29935a",
"x-rapidapi-host": "rest-countries10.p.rapidapi.com"
}
COVID19 API:
https://data.covid19india.org/data.json
https://api.dictionaryapi.dev/api/v2/entries/en/hello
https://themewagon.com/theme-price/free/
Products api:
https://dummyjson.com/products
https://dummyjson.com/products/search?q={categ
ory}
https://dummyjson.com/products/categories
https://dummyjson.com/products/{id}
https://dummyjson.com/products/category/{categ
ory}
Jokes Template :
https://drive.google.com/file/d/10ILSmyyGo2n6dgxGJv2-9
1LcZSEsZNgn/view?usp=sharing
Recipes api
https://dummyjson.com/recipes