29:31 Fruit ripeness checker fruit = input('Enter your fruit : ') if fruit == 'banana': color = input('Enter the color of your fruit : ') if color == 'green': print("You're fruit is unripe..") elif color == 'yellow': print("You're fruit is perfectly ripe") elif color == 'brown': print("You're fruit is overripe..") else : print("Enter the correct color..!") else : print("You're fruit is not banana")
29:29 04 problem : => if fruit == "Banana": if color == "Green": print("Unripe") elif color == "Yellow": print("Ripe") elif color == "Brown": print("OverRipe") else: print("I have no data for other fruit right now only banana fruit acceptable")
One of the Best python course on TH-cam & better than Edtech companies like Scaler, udemy, Simplilarn,Upgrade............Thanks Hitesh sir ji....Respect from Bangalore.
#Solution_10 (Pet Food Recommendation) pet = input("Enter Pet Type: ") pet_age = int(input("Enter Pet Age: ")) if pet == "Dog": if pet_age < 2: print ("Puppy Food") else: print("Adult Food") elif pet == "Cat": if pet_age > 5: print ("Senior cat food") else: print("Baby cat food") else: print("Sorry This Pet Is Not Defind") i_tried_sir❤
Literally the first course where i've come this far! Your style of teaching the topics to the point helps me a lot. I'm the kind of person to get bored easily, and usually it's difficult for me to be interested and consistent in coding. But i enjoy coding this time, and am genuinely getting involved with python language. Thanks a lot for your valuable efforts!
i used if score in range(90,100): print("A") elif score in range(80,89): print("B") elif score in range(70,79): print("C") elif score in range (60,69): print("D") elif score
52:36 Pet food recommendation userPet = input("Which pet do you have ? : ") pet = userPet.lower() if (pet == 'dog') or (pet == 'puppy'): dogAge = float(input("Enter you're dog's age : ")) if dogAge < 2: print("Recommends to give puppy food") else: print("Recommends to give senior dog food") elif (pet == 'cat') or (pet == 'kitten'): catAge = float(input("Enter you're cat's age : ")) if catAge < 5: print("Recommends to give kitten food") else: print("Recommends to give senior cat food") else: print("No data for this pet..")
Fruit ripening checker: code using match statement color = input("Enter the color of your banana: ").lower() match color: case 'green': print("Your banana is Unripe!") case 'yellow': print("Your banana is Ripe!") case 'brown': print("Your banana is Overripe!") case _: print("Invalid Color") Thank you so much sir!
Thank you so much Sir for this series, I used to program in school and then lost touch due to a different engineering background, Getting back to it. And this is the gem I have Been looking for a long time
02 problem --> age = int(input("Enter your Age : ")) day = input("Enter a day : ") price_over_18 = 12 price_less_18 = 8 if age >= 18: if day == "Wednesday": price_over_18 = price_over_18 - 2 print(price_over_18) else : print(price_over_18)
elif age < 18: if day == "Wednesday": price_less_18 = price_less_18 - 2 print(price_less_18) else: print(price_less_18)
00:02 Transitioning to problem solving in Python. 02:11 Creating a program to classify age groups in Python 06:37 Taking user input in Python 08:33 Conditional age classification in Python 12:35 Checking age conditions in Python 14:52 Solving conditional problems in Python through simulation 18:48 New syntax for conditional statements 20:35 Manipulating the price value based on the day of the week 24:23 Conditional grading based on score range in Python 26:18 Checking and assigning grades in Python 30:19 Handling conditional statements in Python 32:20 Learn how to make fruit color checkers and suggest activities based on weather in Python. 36:18 Solving conditional problems with distance calculations in Python 38:38 Using conditional statements to make decisions in Python. 42:41 Determining password strength using Python 44:49 Understanding the leap year problem and its solution in Python. 48:29 Checking conditions for leap year in Python 50:24 Understanding leap year conditions in Python Crafted by Merlin AI.
00:02 Transitioning to problem solving in Python. 02:11 Creating a program to classify age groups in Python 06:37 Taking user input in Python 08:33 Conditional age classification in Python 12:35 Checking age conditions in Python 14:52 Solving conditional problems in Python through simulation 18:48 New syntax for conditional statements 20:35 Manipulating the price value based on the day of the week 24:23 Conditional grading based on score range in Python 26:18 Checking and assigning grades in Python 30:19 Handling conditional statements in Python 32:20 Learn how to make fruit color checkers and suggest activities based on weather in Python. 36:18 Solving conditional problems with distance calculations in Python 38:38 Using conditional statements to make decisions in Python. 42:41 Determining password strength using Python 44:49 Understanding the leap year problem and its solution in Python. 48:29 Checking conditions for leap year in Python 50:24 Understanding leap year conditions in Python
Learning with practicle examples is the best way to learn Coding.....Thanks hitesh sir ji......you are a Awsome teacher, teaching coding concepts & logic building in a simple and effective manner............Respect from Bangalore...
04_solution (a lil imporved version) fruit = str(input("ENTER THE NAME OF FRUIT:")) fruit = str(input("ENTER THE NAME OF FRUIT:")) if fruit == "banana": color = str(input("ENTER THE COLOR OF FRUIT:")) if color == "green": print("UNRIPE") elif color == "yellow": print("RIPE") elif color == "brown": print("OVERRIPE") else: print("Could not recognise the color") else: print("I do not have any information about", fruit )
Solution 4: #Fruit Ripeness Checker fruit = input("Enter your fruit name: ") color = input("Enter you fruit color: ") if fruit == "Banana": if color == "Green" : print("Unripe") elif color == "Yellow": print("Ripe") elif color == "Brown": print("OverRipe")
def is_ripen(a): if a== "green": print("not ripprn at all") elif a== "yellow" or "red" : print("perfectly rippen") elif a=="brown": print("overripen") else: print("hard to determine!") a =str(input("enter the colour:")).lower() is_ripen(a) ans--4
Pet food recommendation: pet=input("Enter pet name: ") if pet!= "dog" and "cat": print("can't recognise") exit() age=int(input("Enter pet age: ")) if pet=="dog": if age5: print("senior cat food") else: print("kitten food") else: print("invalid entry")
fruit = "Bananna" color = input() if color=="yellow" : print("the banana is ripe ") elif color =="green": print("the banana is Unripe") elif color == "brown": print("the banana is overripe")
mark = int(input("Enter your marks: ")) if mark > 100: print("Marks cannot exceed 100.") else: if mark > 90: print("A") elif mark > 80: print("B") elif mark > 70: print("C") elif mark > 60: print("D") else: print("F")
started doing the problem by myself after the problem 2. 04 problem: fruit=str(input("Name the fruit:")) color=str(input("say the color of the fruit:")) if color.lower()=="green": print(f"The {fruit} is unripe") #use the formatted string. use f before" elif color.lower()=="yellow": print(f"The {fruit} is ripe") elif color.lower()=="brown": print(f"The {fruit} is overripe") else: print(f"The ripeness for the {fruit} is unknown for the {color}")
Third problem (Optimised) mark = 35 fruits = {"90-100":"A grade student","80-89":"B grade student","70-79":"C grade student","60-69":"D grade student"} for x in fruits: marksRange = x.split('-') if mark > int(marksRange[0]) and mark < int(marksRange[1]): print(fruits[x])
Solution 9 Different method: years = input("Give year") year = int(years) if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: print("Leap year") else: print("Not a leap year") else : print("Leap year")
Solution 10: Pet food recommender pet = 'dog' age = 33 if pet == 'cat': if age < 5: print("Feed your cat kitten food") else: print("Feed your cat Senior cat food") elif pet == 'dog': if age < 2: print("Feed your dog puppy food") else: print("Feed your dog adult dog food") else: print("I don't know what to feed this pet")
Slightly modified solution: # Pet food recommender pet = input("What type of pet do you have? ") age = int(input("How old is your pet? ")) if pet.lower() == 'cat': if age < 5: print("Feed your cat kitten food") else: print("Feed your cat Senior cat food") elif pet.lower() == 'dog': if age < 2: print("Feed your dog puppy food") else: print("Feed your dog adult dog food") else: print("I don't know what to feed this pet")
Pet = input('Enter Pet species: ').lower() Age = int(input('Enter age')) if Pet == 'dog' and age < 2: print('Give Puppy food') elif Pet == 'cat' and age < 5: print('Give Senior Cat food') else: print('Give Normal food') Output: Enter Pet species: dog Enter age 3 Give Puppy food
def leap_or_not(a): if (a%4==0 and a%100!=0) or a%400==0: print("year is a leap") else: print("year is not a leap") a = float(input("enter the year:")) leap_or_not(a) ans--9
qno.2 child_price1 = 8 child_price2 =6 adult_price1 = 10 adult_price2 = 8 day = input("enter the day of the week") user_age = int(input("enter your age ")) if(user_age < 18 and day =="wednesday"): print("the ticket cost for you will be $", child_price2,"beacuse you are a child and today is wednesay") elif(user_age < 18 and day != "wednesday"): print("the ticket cost for you will be", child_price1) elif(user_age >= 18 and day =="wednesday"): print("the cost of ticket for you will be ", adult_price2, "beacuse you are a adult and today is wednesday") elif(user_age >= 18 and day !="wednesday"): print(" the cost of the ticket for you will be ", adult_price1)
marks = int(input("enter your marks=>")) if marks >= 101: print("VERIFY YOUR GRADE!!") if(marks >= 90 and marks ==100): print("your grade is A") elif(marks >= 80 and marks < 90): print("your grade is B") elif(marks > 70 and marks < 80): print("your grade is C") elif(marks < 70 and marks >= 60): print("your grade is D") elif(marks < 60): print('your grade is F')
Last problem solution: year = int(input("Please mention the pet's age :")) if year = 5: pet_food = "Senior Cat food" print("please give " + pet_food + " to your pet")
pet = "Cat" age = 2 if pet == "Dog": if age 5: food = "Super cat food" else: food = "Baby cat food" else: print("sorry pet not identified") print(food)
Solution 3 : std_score = int(input("Your score: ")) if std_score >= 101: print("Please verify your grade") exit() if std_score = 60 and std_score = 70 and std_score = 80 and std_score = 90 and std_score
More optimized code for Q9 (also year is taken by user): year = int(input("Enter the Year: ")) if year % 400 == 0 or year % 4 == 0: print(f"{year} is a leap year") else: print(f"{year} is not a leap year")
Solution 3:- marks = int(input("Enter student's marks here: ")) if marks>100: print("Invalid input") elif marks >= 90: print("Grade A") elif marks >= 80 and marks < 90: print("Grade B") elif marks >= 70 and marks < 80: print("Grade C") elif marks >= 60 and marks < 70: print("Grade D") else: print("Grade F")
This is mine age=int(input("Give me an age! ")) day=input("Give me an day! ") if age > 17: if (day == "Wednesday"): print("$10") else: print("$12") else: if (day == "Wednesday"): print("$6") else: print("$8")
#10 (One approach) pet='Dog' age=1 if (pet == "Dog") and (age < 2): print ("The recommended food is Puppy Food") elif (pet == "Dog") and (age > 2): print ("The recommended food is Dog Food") elif (pet == "Cat") and (age < 5): print ("The recommended food is Junior cat food") elif (pet == "Cat") and (age > 5): print ("The recommended food is Senior cat food") else: print ("Please provide valid data.")
Weather = "Rainy" if "Sunny" in Weather: print("Go For Walk") elif "Rainy" in Weather: print("Read a Book") elif "Snowy" in Weather: print("Build a Snowman")
my Solution 1: age = input("Please enter your age here: ") age_int = int(age) if age_int < 13: print("Child") elif age_int > 13 and age_int < 19 or age_int == 19 or age_int == 13: print("Teenager") elif age_int > 20 and age_int < 59 or age_int == 59 or age_int == 20: print("Adult") else: print("Senior")
solution:04 fruit = "brown" if fruit == "Green": color = "Unripe" elif fruit == "Yellow": color = "Ripe" elif fruit == "Brown": color = "Overripe" else: color = "Not Check" print("Your Bananas are", color)
fruit = input("Enter the fruit: ") color = input("Enter the color: ") if fruit == "Banana": if color == "Green": print("The Banana is Unripe") elif color == "Yellow": print("The Banana is Ripe") elif color == "Brown": print("The Banana is Overripe") else: print("The Banana is not yet ripe") else: print("The fruit is not a Banana")
problem 9 solution year = int(input("Enter a year: ")) if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): print(f"{year} is a leap year") else: print(f"{year} is not a leap year")
sir ans=10 name = Muhammad Anees in Pakistan pet_species = input('Enter the pet specices(cat/dog):').lower() pet_age = int(input('Enter the pet age : ')) if pet_species =='dog': if pet_age 5: print('senior cat food ') else : print('Junior cat food') else: print('sorry')
question 10 solution or isme ek feature add kiya he jisme hum user ke pas se value le sakte he pet = str(input("enter your pet (dog or cat):")) age = int(input("enter your pet age : ")) if pet == "Dog" and age 5: print("Senior cat food") else: print("You don't have a pet that suits our limit")
question 10- ``` animal = 'dog' age = 2 if animal == 'dog': if age >2: food = 'senior dog food' else: food = 'puppy dog food' if animal == 'cat': if age >2: food = 'senior cat food' else: food = 'puppy cat food' print(food," ",animal," ",age) ``` with some addone things in code
ANSWER NO.10 pet =input("choose your pet species: [dog,cat]") pet_lower=pet.lower() age =int(input("write age of your species: ")) if pet_lower=="dog" and age=2: print("your dog is adult") elif pet_lower=="cat" and age>=5: print("give senior cat food") elif pet_lower=="cat" and age
# Problem: Determine if a year is a leap year. (Leap years are divisible by 4, but not by 100 unless also divisible by 400). year:int = int(input("Enter Year")) if (not year%400) or (not year%4 and year%100): print(year,"is a leap year") else: print(year,"is not a leap year")
This pedagogy of teaching is really awesome, solving problems hand-to-hand is better than watching endless videos with syntax breakdowns.
29:31 Fruit ripeness checker
fruit = input('Enter your fruit : ')
if fruit == 'banana':
color = input('Enter the color of your fruit : ')
if color == 'green':
print("You're fruit is unripe..")
elif color == 'yellow':
print("You're fruit is perfectly ripe")
elif color == 'brown':
print("You're fruit is overripe..")
else :
print("Enter the correct color..!")
else :
print("You're fruit is not banana")
29:29 04 problem : => if fruit == "Banana":
if color == "Green":
print("Unripe")
elif color == "Yellow":
print("Ripe")
elif color == "Brown":
print("OverRipe")
else:
print("I have no data for other fruit right now only banana fruit acceptable")
29:36 ->>>>>
fruit = str(input("Enter fruit: "))
colour = str(input("Enter color: "))
if colour == "Green":
print(fruit , "is unripe")
elif colour == "Yellow":
print(fruit , "is ripe")
else:
print(fruit , "is over ripe")
One of the Best python course on TH-cam & better than Edtech companies like Scaler, udemy, Simplilarn,Upgrade............Thanks Hitesh sir ji....Respect from Bangalore.
#Solution_10 (Pet Food Recommendation)
pet = input("Enter Pet Type: ")
pet_age = int(input("Enter Pet Age: "))
if pet == "Dog":
if pet_age < 2:
print ("Puppy Food")
else:
print("Adult Food")
elif pet == "Cat":
if pet_age > 5:
print ("Senior cat food")
else:
print("Baby cat food")
else:
print("Sorry This Pet Is Not Defind")
i_tried_sir❤
I attempted all the problems and even watched your solutions to know different approaches for the problem. Thanks for the series!
Literally the first course where i've come this far! Your style of teaching the topics to the point helps me a lot. I'm the kind of person to get bored easily, and usually it's difficult for me to be interested and consistent in coding. But i enjoy coding this time, and am genuinely getting involved with python language. Thanks a lot for your valuable efforts!
i used
if score in range(90,100):
print("A")
elif score in range(80,89):
print("B")
elif score in range(70,79):
print("C")
elif score in range (60,69):
print("D")
elif score
what if a person got 100,89,79,69---- would it not give invalid score.
52:36 Pet food recommendation
userPet = input("Which pet do you have ? : ")
pet = userPet.lower()
if (pet == 'dog') or (pet == 'puppy'):
dogAge = float(input("Enter you're dog's age : "))
if dogAge < 2:
print("Recommends to give puppy food")
else:
print("Recommends to give senior dog food")
elif (pet == 'cat') or (pet == 'kitten'):
catAge = float(input("Enter you're cat's age : "))
if catAge < 5:
print("Recommends to give kitten food")
else:
print("Recommends to give senior cat food")
else:
print("No data for this pet..")
👏👏
Too many errors
@@TooniMe It worked perfectly fine on my laptop.
Pet = Puppy initi. Karna Kya jaruri hai ,kyuki isi ke liye do bar if use ho Raha hai?
Fruit ripening checker: code using match statement
color = input("Enter the color of your banana: ").lower()
match color:
case 'green':
print("Your banana is Unripe!")
case 'yellow':
print("Your banana is Ripe!")
case 'brown':
print("Your banana is Overripe!")
case _:
print("Invalid Color")
Thank you so much sir!
Q-3 25:55
# Q-3
marks = 699;
if marks >= 90 and marks < 101:
print("A")
elif marks >= 80 and marks = 70 and marks = 60 and marks
52:28 problem 10-
Pet= input("What Pet do you have?").lower()
Age= int(input("What is the age of your pet?"))
if Pet == "dog":
if Age
Thank you so much Sir for this series, I used to program in school and then lost touch due to a different engineering background, Getting back to it. And this is the gem I have Been looking for a long time
pet_species=input("Enter the species: ")
pet_age=int(input("Enter the age: "))
if((pet_species=="dog")):
if(pet_age5):
print("Senior cat food")
else:
print("Junior cat food")
02 problem -->
age = int(input("Enter your Age : "))
day = input("Enter a day : ")
price_over_18 = 12
price_less_18 = 8
if age >= 18:
if day == "Wednesday":
price_over_18 = price_over_18 - 2
print(price_over_18)
else :
print(price_over_18)
elif age < 18:
if day == "Wednesday":
price_less_18 = price_less_18 - 2
print(price_less_18)
else:
print(price_less_18)
36:03
distance = int(input("Enter the distance (in K.M.): "))
if (distance < 3) :
mode_of_transportation = "walk"
elif (distance < 16):
mode_of_transportation = "Bike"
else:
mode_of_transportation = "Car"
print("Your total distance is",distance,". So you should prefer",mode_of_transportation,".")
As soon as you say, who are actively learning(Fruit Ripeness Checker) i went to vs code and solve it. Now i will watch the solution.
00:02 Transitioning to problem solving in Python.
02:11 Creating a program to classify age groups in Python
06:37 Taking user input in Python
08:33 Conditional age classification in Python
12:35 Checking age conditions in Python
14:52 Solving conditional problems in Python through simulation
18:48 New syntax for conditional statements
20:35 Manipulating the price value based on the day of the week
24:23 Conditional grading based on score range in Python
26:18 Checking and assigning grades in Python
30:19 Handling conditional statements in Python
32:20 Learn how to make fruit color checkers and suggest activities based on weather in Python.
36:18 Solving conditional problems with distance calculations in Python
38:38 Using conditional statements to make decisions in Python.
42:41 Determining password strength using Python
44:49 Understanding the leap year problem and its solution in Python.
48:29 Checking conditions for leap year in Python
50:24 Understanding leap year conditions in Python
Crafted by Merlin AI.
Your way of teaching seems effortless amd easy to understand. But this requires lots of efforts in bg thankyou 🙏
00:02 Transitioning to problem solving in Python.
02:11 Creating a program to classify age groups in Python
06:37 Taking user input in Python
08:33 Conditional age classification in Python
12:35 Checking age conditions in Python
14:52 Solving conditional problems in Python through simulation
18:48 New syntax for conditional statements
20:35 Manipulating the price value based on the day of the week
24:23 Conditional grading based on score range in Python
26:18 Checking and assigning grades in Python
30:19 Handling conditional statements in Python
32:20 Learn how to make fruit color checkers and suggest activities based on weather in Python.
36:18 Solving conditional problems with distance calculations in Python
38:38 Using conditional statements to make decisions in Python.
42:41 Determining password strength using Python
44:49 Understanding the leap year problem and its solution in Python.
48:29 Checking conditions for leap year in Python
50:24 Understanding leap year conditions in Python
Solution 10:
pet = "cat"
age = 6
if pet == "Dog" and age 5:
print("Senior cat food")
else:
print("You don't have a pet that suits our limit")
Thanks BHA
Learning with practicle examples is the best way to learn Coding.....Thanks hitesh sir ji......you are a Awsome teacher, teaching coding concepts & logic building in a simple and effective manner............Respect from Bangalore...
29:31 Pause before every solution and tried to solve everything by myself.
04_solution (a lil imporved version)
fruit = str(input("ENTER THE NAME OF FRUIT:"))
fruit = str(input("ENTER THE NAME OF FRUIT:"))
if fruit == "banana":
color = str(input("ENTER THE COLOR OF FRUIT:"))
if color == "green":
print("UNRIPE")
elif color == "yellow":
print("RIPE")
elif color == "brown":
print("OVERRIPE")
else:
print("Could not recognise the color")
else:
print("I do not have any information about", fruit )
While taking input for enter the name of fruit no need to convert to string as input function by default taking input value as a string only
I don't know why people aren't appreciating this quality content, this is prolly the best ever playlist for python out there
best problems exersice ever on youtube........for free
Solution 4:
#Fruit Ripeness Checker
fruit = input("Enter your fruit name: ")
color = input("Enter you fruit color: ")
if fruit == "Banana":
if color == "Green" :
print("Unripe")
elif color == "Yellow":
print("Ripe")
elif color == "Brown":
print("OverRipe")
banana = "green"
if banana == "green":
print("UnRipe ")
elif banana == "yellow":
print("Ripe")
else:
print("OverRipe ")
def is_ripen(a):
if a== "green":
print("not ripprn at all")
elif a== "yellow" or "red" :
print("perfectly rippen")
elif a=="brown":
print("overripen")
else:
print("hard to determine!")
a =str(input("enter the colour:")).lower()
is_ripen(a)
ans--4
Pet food recommendation:
pet=input("Enter pet name: ")
if pet!= "dog" and "cat":
print("can't recognise")
exit()
age=int(input("Enter pet age: "))
if pet=="dog":
if age5:
print("senior cat food")
else:
print("kitten food")
else:
print("invalid entry")
fruit = "Bananna"
color = input()
if color=="yellow" :
print("the banana is ripe ")
elif color =="green":
print("the banana is Unripe")
elif color == "brown":
print("the banana is overripe")
distance = 3
if distance
Sir kya mast approach hain padhane ka...swaad aa gaya💕🔥
def price(a,b):
a =int(a)
b =str(b).lower()
if a=18 and b!="wednesday":
print("price is $12")
a =int(input("enter the age:"))
b = str(input("entere the day:"))
price(a,b)
ans--2
mark = int(input("Enter your marks: "))
if mark > 100:
print("Marks cannot exceed 100.")
else:
if mark > 90:
print("A")
elif mark > 80:
print("B")
elif mark > 70:
print("C")
elif mark > 60:
print("D")
else:
print("F")
Awesome,had fun solving the problems. Thankyou.
started doing the problem by myself after the problem 2.
04 problem:
fruit=str(input("Name the fruit:"))
color=str(input("say the color of the fruit:"))
if color.lower()=="green":
print(f"The {fruit} is unripe") #use the formatted string. use f before"
elif color.lower()=="yellow":
print(f"The {fruit} is ripe")
elif color.lower()=="brown":
print(f"The {fruit} is overripe")
else:
print(f"The ripeness for the {fruit} is unknown for the {color}")
Third problem (Optimised)
mark = 35
fruits = {"90-100":"A grade student","80-89":"B grade student","70-79":"C grade student","60-69":"D grade student"}
for x in fruits:
marksRange = x.split('-')
if mark > int(marksRange[0]) and mark < int(marksRange[1]):
print(fruits[x])
you can take grades as a variable name instead of fruits for more readable code.
year=int (input("enter year:"))
if (year%400==0)or(year%4==0 and year%100!=0):
print("year is a leap year:",year)
else:
print("year is not leap year")
Solution 9 Different method:
years = input("Give year")
year = int(years)
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
print("Leap year")
else:
print("Not a leap year")
else :
print("Leap year")
else:
print("Not a Leap Year")
Love this approach....art of learning continues....
ans-----1
def age(a):
a =float(a)
if a
If someone accidentally enters a negative number it will print senior citizens.
in 22:53 we can do this
print("Ticket price for you is ${}".format(price))
def grade(a):
if 90
Pretty straightforward and full of knowledge at the same time 😍😍
species = "dog"
age = 5
if species=="dog":
if age
Solution 10: Pet food recommender
pet = 'dog'
age = 33
if pet == 'cat':
if age < 5:
print("Feed your cat kitten food")
else:
print("Feed your cat Senior cat food")
elif pet == 'dog':
if age < 2:
print("Feed your dog puppy food")
else:
print("Feed your dog adult dog food")
else:
print("I don't know what to feed this pet")
Slightly modified solution:
# Pet food recommender
pet = input("What type of pet do you have? ")
age = int(input("How old is your pet? "))
if pet.lower() == 'cat':
if age < 5:
print("Feed your cat kitten food")
else:
print("Feed your cat Senior cat food")
elif pet.lower() == 'dog':
if age < 2:
print("Feed your dog puppy food")
else:
print("Feed your dog adult dog food")
else:
print("I don't know what to feed this pet")
problem 2
age = int(input("enter age:"))
day = input("what is today : ")
if age
def pasword(a):
if len(a)
problem 6 solution
dis= int(input("enter distance in km:-"))
if dis
#10 assignment (pet recommendation)
pet = "Do"
age = 10
if pet == "Dog":
if age < 2:
food = "Puppy food"
else:
food = "Adult food"
elif pet == "Cat":
if age > 5:
food = "Senior cat foof"
else:
food = "Junior cat food"
else:
food = "something went wrong!"
print(food)
Sir thelka hoga TH-cam k platform pr best python playlist never taught by anyone 🎉🎉🎉
Pet = input('Enter Pet species: ').lower()
Age = int(input('Enter age'))
if Pet == 'dog' and age < 2:
print('Give Puppy food')
elif Pet == 'cat' and age < 5:
print('Give Senior Cat food')
else:
print('Give Normal food')
Output:
Enter Pet species: dog
Enter age 3
Give Puppy food
def leap_or_not(a):
if (a%4==0 and a%100!=0) or a%400==0:
print("year is a leap")
else:
print("year is not a leap")
a = float(input("enter the year:"))
leap_or_not(a)
ans--9
order=input("enter order")
extra=True
if extra:
coffee=order+"coffee with an extra shot"
else:
coffee=order+"coffee"
print(coffee)
This is one of the best course on youtube
q.no1
user_age = int(input("enter your age:"))
if(user_age < 13):
print("your're a child:")
elif(user_age >= 13 and user_age =20 and user_age = 60):
print("you're a senior citizen:")
qno.2
child_price1 = 8
child_price2 =6
adult_price1 = 10
adult_price2 = 8
day = input("enter the day of the week")
user_age = int(input("enter your age "))
if(user_age < 18 and day =="wednesday"):
print("the ticket cost for you will be $", child_price2,"beacuse you are a child and today is wednesay")
elif(user_age < 18 and day != "wednesday"):
print("the ticket cost for you will be", child_price1)
elif(user_age >= 18 and day =="wednesday"):
print("the cost of ticket for you will be ", adult_price2, "beacuse you are a adult and today is wednesday")
elif(user_age >= 18 and day !="wednesday"):
print(" the cost of the ticket for you will be ", adult_price1)
marks = int(input("enter your marks=>"))
if marks >= 101:
print("VERIFY YOUR GRADE!!")
if(marks >= 90 and marks ==100):
print("your grade is A")
elif(marks >= 80 and marks < 90):
print("your grade is B")
elif(marks > 70 and marks < 80):
print("your grade is C")
elif(marks < 70 and marks >= 60):
print("your grade is D")
elif(marks < 60):
print('your grade is F')
color = "green"
fruit = "banana"
if "banana" in fruit:
if "green" in color:
print("Unripe")
elif "yellow" in color:
print("Ripe")
elif "brown" in color:
print("Over-Ripe")
Color_fruit=input("Enter the colour of the fruit")
if Color_fruit=="yellow":
print("Ripe")
elif Color_fruit=="green" :
print("unripe")
elif Color_fruit=="brown":
print("over ripe")
else:
print("not applicable")
Please sab support kro yr ...python bhi sikh lete hai apne aap ko versatile bnane ka samay aa gya h
Last problem solution:
year = int(input("Please mention the pet's age :"))
if year = 5:
pet_food = "Senior Cat food"
print("please give " + pet_food + " to your pet")
I was looking for such a short playlist for python tutorial. thanku...
i like your teaching style and your research base study
pet = "Cat"
age = 2
if pet == "Dog":
if age 5:
food = "Super cat food"
else:
food = "Baby cat food"
else:
print("sorry pet not identified")
print(food)
great loved it.. feels like a story very easy to understand
Solution 3 :
std_score = int(input("Your score: "))
if std_score >= 101:
print("Please verify your grade")
exit()
if std_score = 60 and std_score = 70 and std_score = 80 and std_score = 90 and std_score
More optimized code for Q9 (also year is taken by user):
year = int(input("Enter the Year: "))
if year % 400 == 0 or year % 4 == 0:
print(f"{year} is a leap year")
else:
print(f"{year} is not a leap year")
Solution 3:-
marks = int(input("Enter student's marks here: "))
if marks>100:
print("Invalid input")
elif marks >= 90:
print("Grade A")
elif marks >= 80 and marks < 90:
print("Grade B")
elif marks >= 70 and marks < 80:
print("Grade C")
elif marks >= 60 and marks < 70:
print("Grade D")
else:
print("Grade F")
10 solution:
pat = "Cat"
patyear = 1
if pat == "Dog":
if patyear < 2:
food = "puppy food"
else:
food = "Adult food"
elif pat == "Cat":
if patyear > 5:
food = "Senior food"
else:
food = "Jurior food"
else:
food = "Not found"
print(pat,"eat",food)
great video and superb quality sir!!
This is mine
age=int(input("Give me an age! "))
day=input("Give me an day! ")
if age > 17:
if (day == "Wednesday"):
print("$10")
else:
print("$12")
else:
if (day == "Wednesday"):
print("$6")
else:
print("$8")
#10 (One approach)
pet='Dog'
age=1
if (pet == "Dog") and (age < 2):
print ("The recommended food is Puppy Food")
elif (pet == "Dog") and (age > 2):
print ("The recommended food is Dog Food")
elif (pet == "Cat") and (age < 5):
print ("The recommended food is Junior cat food")
elif (pet == "Cat") and (age > 5):
print ("The recommended food is Senior cat food")
else:
print ("Please provide valid data.")
Weather = "Rainy"
if "Sunny" in Weather:
print("Go For Walk")
elif "Rainy" in Weather:
print("Read a Book")
elif "Snowy" in Weather:
print("Build a Snowman")
solution 4:
color_and_status = {
"Green": "Unripe",
"Yellow": "Ripe",
"Brown": "Overripe"
}
color_of_banana = "Green"
for key, value in color_and_status.items():
if color_of_banana == key:
print(value)
my Solution 1:
age = input("Please enter your age here: ")
age_int = int(age)
if age_int < 13:
print("Child")
elif age_int > 13 and age_int < 19 or age_int == 19 or age_int == 13:
print("Teenager")
elif age_int > 20 and age_int < 59 or age_int == 59 or age_int == 20:
print("Adult")
else:
print("Senior")
In love with this series by Hitesh Sir.
solution:04
fruit = "brown"
if fruit == "Green":
color = "Unripe"
elif fruit == "Yellow":
color = "Ripe"
elif fruit == "Brown":
color = "Overripe"
else:
color = "Not Check"
print("Your Bananas are", color)
problem 8 solution
password = input("Enter a password : ")
if len(password) < 6:
print("Your password is weak")
elif len(password)
Solution 5:
weather = input("how's weather?
")
if weather == "Sunny":
print("GO RUN")
elif weather == "Rainy":
print("GO RUNN HARDD")
elif weather == "Snowy":
print("FUCKING GO RUNNNNNN")
pet = input("Enter pet: ")
pet_age = int(input("pet age: "))
if pet == "dog":
if pet_age < 2:
print("Give puppy food")
else:
print("Give adult Food")
elif pet == "cat":
if pet_age < 2:
print("Give kitty food")
else:
print("Give adult Food")
else:
print("Error!")
pet_species = "Cat"
pet_age = 6
if(pet_species == "Dog" and pet_age < 2):
print("Puppy Food")
elif(pet_species == "Cat" and pet_age > 5):
print("Senior cat Food")
else:
print("Check the values")
Thank You for such a wonderful and Knowledgeable video.
fruit = input("Enter the fruit: ")
color = input("Enter the color: ")
if fruit == "Banana":
if color == "Green":
print("The Banana is Unripe")
elif color == "Yellow":
print("The Banana is Ripe")
elif color == "Brown":
print("The Banana is Overripe")
else:
print("The Banana is not yet ripe")
else:
print("The fruit is not a Banana")
problem 9 solution
year = int(input("Enter a year: "))
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
print(f"{year} is a leap year")
else:
print(f"{year} is not a leap year")
sir ans=10
name = Muhammad Anees in Pakistan
pet_species = input('Enter the pet specices(cat/dog):').lower()
pet_age = int(input('Enter the pet age : '))
if pet_species =='dog':
if pet_age 5:
print('senior cat food ')
else :
print('Junior cat food')
else:
print('sorry')
age=int(input("Enter your age"))
day=input("Enter the day")
if(age
question 10 solution or isme ek feature add kiya he jisme hum user ke pas se value le sakte he
pet = str(input("enter your pet (dog or cat):"))
age = int(input("enter your pet age : "))
if pet == "Dog" and age 5:
print("Senior cat food")
else:
print("You don't have a pet that suits our limit")
great efforts for all series !
question 10-
```
animal = 'dog'
age = 2
if animal == 'dog':
if age >2:
food = 'senior dog food'
else:
food = 'puppy dog food'
if animal == 'cat':
if age >2:
food = 'senior cat food'
else:
food = 'puppy cat food'
print(food," ",animal," ",age)
```
with some addone things in code
## answer of 10th Question ###
animal = input("give animal type :")
animal_type = animal.lower()
age = input("give animal age :")
animal_age = int(age)
if (animal_type == "dog" and animal_age < 2):
print("feed puppy food")
elif (animal_type == "cat" and animal_age > 5):
print("feed senior cat food")
else:
print("invalid request")
ANSWER NO.10
pet =input("choose your pet species:
[dog,cat]")
pet_lower=pet.lower()
age =int(input("write age of your species:
"))
if pet_lower=="dog" and age=2:
print("your dog is adult")
elif pet_lower=="cat" and age>=5:
print("give senior cat food")
elif pet_lower=="cat" and age
# Problem: Determine if a year is a leap year. (Leap years are divisible by 4, but not by 100 unless also divisible by 400).
year:int = int(input("Enter Year"))
if (not year%400) or (not year%4 and year%100):
print(year,"is a leap year")
else:
print(year,"is not a leap year")
Thank you hitesh sir for making such wonderful series ❤
type_of_pet = "Dog"
age_of_pet = 5
if type_of_pet == "Dog":
if age_of_pet < 2:
print("Please give Puppy food")
else:
print("Please give adult food")
elif type_of_pet == "Cat":
if age_of_pet > 5:
print("Please give senior cat food")
else:
print("Please give Junior cat food")
Thank you so much❤❤❤
Finally understood Leap Year logic so easily!!
Dear Hitesh I am used. To with c and. C plus plus and I stated with python
Always excited for next video in series 😊
Glad to hear that
@@chaiaurcode Than You
2nd -
Mathematics = int(input("Please provide Maths number: "))
Physics = int(input("Please provide Physics number: "))
Chemistry = int(input("Please provide Chemistry number: "))
Hindi = int(input("Please provide Hindi number: "))
English = int(input("Please provide English number: "))
score = ((Mathematics+Physics+Chemistry+Hindi+English)/500)*100
cgpa = score/9.5
grade = "0"
if score>90:
grade = "A"
elif score>80:
grade = "B"
elif score>70:
grade = "C"
elif score>60:
grade = "D"
elif score