Rikay21

Apple.py

Oct 14th, 2021
599
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pilihan = 'y'
  2. #nilai variabel "pilihan" adalah 'y', kalau tidak dibilang, akan error.
  3.                                    
  4. while (pilihan.lower() != 'n'):
  5. #disaat variabel "pilihan" bukan 'n', maka... (note: variabel.lower() merupakan command agar mengabaikan case sensitive)
  6.  
  7.     temukan = input("Search your fruit: ")
  8.     #nilai variabel "temukan" ditentukan oleh input yang dimasukkan oleh user.
  9.  
  10.     if temukan.lower()=="apple":
  11.     #jika nilai variabel "temukan" adalah 'Apple', maka munculkan teks di bawah: (semua hasil akan begini)
  12.         print(" ")
  13.         print("Apple")
  14.         print("NOUN")
  15.         print("1. The round fruit of a tree of the rose family, which typically has thin green or red skin and crisp flesh.")
  16.         print("1.1. Used in names of unrelated fruits or other plant growths that resemble apples in some way, e.g. custard apple, oak apple.")
  17.         print(" ")
  18.         print("(also apple tree)")
  19.         print("The tree bearing apples, with hard pale timber that is used in carpentry and to smoke food.")
  20.         print(" ")
  21.     if temukan.lower()=="apricot":
  22.         print(" ")
  23.         print("Apricot")
  24.         print("NOUN")
  25.         print("1. A juicy, soft fruit of an orange-yellow colour resembling a small peach.")
  26.         print("1.1. [mass noun] An orange-yellow colour like the skin of a ripe apricot.")
  27.         print(" ")
  28.         print("(also apricot tree)")
  29.         print("The tree bearing apricots.")
  30.         print(" ")
  31.     if temukan.lower()=="avocado":
  32.         print(" ")
  33.         print("Avocado (plural noun: avocados)")
  34.         print("NOUN")
  35.         print("1. A pear-shaped fruit with a rough leathery skin and smooth, oily edible flesh.\n(Also called alligator pear.)")
  36.         print("1.1. [mass noun] A light green colour like that of the flesh of avocados.")
  37.         print(" ")
  38.         print("2. The tropical evergreen tree that bears the avocado, native to Central America and widely cultivated elsewhere.")
  39.         print(" ")
  40.         print("(also avocado tree)")
  41.         print("The tree bearing avocado.")
  42.         print(" ")
  43.     if temukan.lower()=="watermelon":
  44.         print(" ")
  45.         print("Watermelon")
  46.         print("NOUN")
  47.         print("1. The large fruit of a plant of the gourd family, with smooth green skin, red pulp, and watery juice.")
  48.         print(" ")
  49.         print("2. The African plant which yields watermelons.")
  50.         print(" ")
  51.     if temukan.lower()=="tamarind":
  52.         print(" ")
  53.         print("Tamarind")
  54.         print("NOUN")
  55.         print("1. [mass noun] Sticky brown acidic pulp from the pod of a tree of the pea family, widely used as a flavouring in Asian cooking.")
  56.         print(" ")
  57.         print("1.1 [count noun] The pod from which tamarind pulp is extracted.")
  58.         print(" ")
  59.     if temukan.lower()=="tangerine":
  60.         print(" ")
  61.         print("Tangerine")
  62.         print("NOUN")
  63.         print("1. A small citrus fruit with a loose skin, especially one of a variety with deep orange-red skin.")
  64.         print(" ")
  65.         print("1.1 [mass noun] A deep orange-red colour.")
  66.         print(" ")
  67.     if temukan.lower()=="pomegranate":
  68.         print(" ")
  69.         print("Pomegranate")
  70.         print("NOUN")
  71.         print("a spherical fruit with a tough golden-orange outer skin and sweet red gelatinous flesh containing many seeds.")
  72.         print(" ")
  73.     if temukan.lower()=="Lychee":
  74.         print(" ")
  75.         print("Lychee")
  76.         print("NOUN")
  77.         print("small rounded fruit with sweet white scented flesh, a large central stone, and a thin rough skin")
  78.         print(" ")
  79.     else:
  80.     #jika nilai variabel "temukan" tidak ditemukan di dalam code, maka print dibawah ini:
  81.         print("Keyword not found.")
  82.         print(" ")
  83.         continue
  84.         #continue adalah code agar langsung memulai dari awal program lagi
  85.    
  86.     pilihan = input("Do you want to search again? (y/n)?")
  87.     #nilai variabel "pilihan" ditentukan oleh user, jika jawabannya y maka akan memulai dari awal program.
RAW Paste Data