DEV Community

Ari Wira Saputra
Ari Wira Saputra

Posted on

Days_7 Nesting Dolls Code

Nesting is a programming concept that exists in many programming languages, including Python. In Python, nesting is the practice of placing one statement within another statement or block of code, such as placing an "if" statement within another "if" statement or within a "for" loop or "while" loop.

Nesting can be useful for evaluating complex conditions and executing certain blocks of code only under certain circumstances. However, it is important to maintain proper indentation when using nested statements in Python, as the correct indentation is crucial to ensure that the code is executed correctly and to avoid syntax errors.

#Nesting Dolls Code
#19 MARCH 2023

def exercies_1():
  TvShow = input("What is your favorite character? ")
  if TvShow == "Peppa Pig":
    FaveCharacter = input("Who is Your Favorite Character? ")
    if FaveCharacter == "Daddy pig":
      print("Right answer")
      print("Nah, Dady pig's the greatest")
  elif TvShow == "paw patrol":
    print("Aww, sad times")
    print("Yeah, That's cool and all....")

def exercies_2():
  order = input("what would you like to order: pizza or humberger?")
  if order == "humburger":
    print("Tanks you")
    cheese = input("Do you wont cheese? ")
    if cheese == "yes":
      print("No cheese it is")
  elif order == "pizza":
    print("Pizza coming up")
    toppings = input("do you wont pepperoni on that?")
    if toppings == "yes":
      print("we will add pepperoni")
      print("your pizza will not have pepperoni")
    print("please, order again")

def exercies_3():
  Movie = input("What kind of movies do you like? ")
  if Movie == "Marvel":
    print("Nice Movie!!!...")
    Filem = input("What kind of movies do you like a Harry Potter? ")
    if Filem == "yes":
      print("nice Movies")
      print("i think so...")
  elif Movie == "disny":
    print("I like Too")
    print("I don't like Movie, I like Music")

def call():

Enter fullscreen mode Exit fullscreen mode

Top comments (0)