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")
#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❤
One of the Best python course on UA-cam & better than Edtech companies like Scaler, udemy, Simplilarn,Upgrade............Thanks Hitesh sir ji....Respect from Bangalore.
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!
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!
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
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.
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 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")
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
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")
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
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...
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])
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}")
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")
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")
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")
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
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")
Question. 10 Pet Food recommendation Recommend a type of pet food based on the pets's species and age.(e.g., Dog: 5 years- Senior cat food) species= "Dog" age = 2 if age
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")
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")
# 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")
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")
This is the code that I wrote for Solution#2(Before looking at Sir Hitesh Code): day = input("Day of The Ticket? ").strip().lower() age = int(input("What Your Age? ")) if day == "wednesday" and age < 18: print("$8, but guess what it's Wednesday, $2 discount! Pay $6") elif day == "wednesday" and age >= 18: print("$12, but guess what it's Wednesday, $2 discount! Pay $10") elif day != "wednesday" and age < 18: print("Pay $8") elif day != "wednesday" and age >= 18: print("Pay $12")
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")
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")
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')
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
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")
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
fruit_colour = "Brown" if fruit_colour == "Green": print("Your Banana fruit is Unripe.") elif fruit_colour == "Yellow": print("Your Banana fruit is properly ripe.") elif fruit_colour == "Brown": print("Your Banana fruit is Overripe.") else: print("Please give proper Input.")
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")
I attempted all the problems and even watched your solutions to know different approaches for the problem. Thanks for the series!
#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❤
One of the Best python course on UA-cam & better than Edtech companies like Scaler, udemy, Simplilarn,Upgrade............Thanks Hitesh sir ji....Respect from Bangalore.
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!
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!
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
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
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.
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
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,".")
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
29:31 Pause before every solution and tried to solve everything by myself.
Your way of teaching seems effortless amd easy to understand. But this requires lots of efforts in bg thankyou 🙏
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")
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
best problems exersice ever on youtube........for free
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
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.
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")
Awesome,had fun solving the problems. Thankyou.
distance = 3
if distance
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
Thank you so much❤❤❤
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")
in 22:53 we can do this
print("Ticket price for you is ${}".format(price))
species = "dog"
age = 5
if species=="dog":
if age
Sir kya mast approach hain padhane ka...swaad aa gaya💕🔥
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...
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.
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}")
order=input("enter order")
extra=True
if extra:
coffee=order+"coffee with an extra shot"
else:
coffee=order+"coffee"
print(coffee)
Pretty straightforward and full of knowledge at the same time 😍😍
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")
Thankyou so much sir!❣️
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")
Love this approach....art of learning continues....
problem 6 solution
dis= int(input("enter distance in km:-"))
if dis
I don't know why people aren't appreciating this quality content, this is prolly the best ever playlist for python out there
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")
#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 UA-cam k platform pr best python playlist never taught by anyone 🎉🎉🎉
great loved it.. feels like a story very easy to understand
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")
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")
osm content . sir jaab aap bolte ho naa soofe mai baithe ho wali line tb mai uth kr code krne lg jata hu 😂
i like your teaching style and your research base study
Thank You for such a wonderful and Knowledgeable video.
def grade(a):
if 90
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
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
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")
This is one of the best course on youtube
I was looking for such a short playlist for python tutorial. thanku...
Bahut hi badhiya padhate hai aap.
Finally understood Leap Year logic so easily!!
problem 2
age = int(input("enter age:"))
day = input("what is today : ")
if age
Question. 10
Pet Food recommendation
Recommend a type of pet food based on the pets's species and age.(e.g., Dog: 5 years- Senior cat food)
species= "Dog"
age = 2
if age
Sir, which one is standard? industry lavel!
i see all three variation gives according result
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")
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")
# 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")
ans-----1
def age(a):
a =float(a)
if a
If someone accidentally enters a negative number it will print senior citizens.
great video and superb quality 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)
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")
This is the code that I wrote for Solution#2(Before looking at Sir Hitesh Code):
day = input("Day of The Ticket? ").strip().lower()
age = int(input("What Your Age? "))
if day == "wednesday" and age < 18:
print("$8, but guess what it's Wednesday, $2 discount! Pay $6")
elif day == "wednesday" and age >= 18:
print("$12, but guess what it's Wednesday, $2 discount! Pay $10")
elif day != "wednesday" and age < 18:
print("Pay $8")
elif day != "wednesday" and age >= 18:
print("Pay $12")
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")
In love with this series by Hitesh Sir.
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")
age=int(input("Enter your age"))
day=input("Enter the day")
if(age
Thank you hitesh sir for making such wonderful series ❤
boom boom lectures 😍😍😍😍😍😍
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")
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")
Please sab support kro yr ...python bhi sikh lete hai apne aap ko versatile bnane ka samay aa gya h
score=101
score=101
if score>=90 and score=80 and score=70 and score=60 and score
def pasword(a):
if len(a)
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)
Amazing Problem Solving Practice with learning 👌
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)
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')
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
Always excited for next video in series 😊
Glad to hear that
@@chaiaurcode Than You
Best explanation sir ❤❤
Dear Hitesh I am used. To with c and. C plus plus and I stated with python
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")
Awesome Explanation !!
score = 67
if score>=90 and score=80 and score=70 and score=60 and score
Thanks alot sir for your efforts on making such a amazing teaching stuff
great efforts for all series !
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
loving the series so far
fruit_colour = "Brown"
if fruit_colour == "Green":
print("Your Banana fruit is Unripe.")
elif fruit_colour == "Yellow":
print("Your Banana fruit is properly ripe.")
elif fruit_colour == "Brown":
print("Your Banana fruit is Overripe.")
else:
print("Please give proper Input.")
"If you give a man a fish, you feed him for a day. If you teach a man to fish, you feed him for a lifetime." - Chinese Proverb
Please don't give Chinese proverbs🙏🙏
They spread such deadly diseases around the world
Please provide with Indian ones🙏🙏♥️
Best series 👏 👌