# Help on this Python exercise

**URL:** <https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [December 13, 2021, 10:20am UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577 "2021-12-13T10:20:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbjimoh](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@kbjimoh](https://forum.freecodecamp.org/u/kbjimoh)\
**Post date:** [December 13, 2021, 10:20am UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/1 "2021-12-13T10:20:26Z")

</div>

prints the sentence “Yes - Spathiphyllum is the best plant ever!” to the screen if the inputted string is `"Spathiphyllum"` (upper-case)  
prints “No, I want a big Spathiphyllum!” if the inputted string is “spathiphyllum” (lower-case)  
prints “Spathiphyllum! Not [input]!” otherwise. Note: [input]` is the string taken as input.

---

<div class="post-metadata">

**Author:** ![sanity](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sanity/32/378897_2.png) [@sanity](https://forum.freecodecamp.org/u/sanity)\
**Post date:** [December 13, 2021, 11:05am UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/2 "2021-12-13T11:05:33Z")

</div>

What’s your code so far?

---

<div class="post-metadata">

**Author:** ![kbjimoh](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@kbjimoh](https://forum.freecodecamp.org/u/kbjimoh)\
**Post date:** [December 13, 2021, 3:32pm UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/3 "2021-12-13T15:32:51Z")

</div>

@sanity

```auto
plant_name = str(("Enter the plant name: "))
name = Spathiphyllum
if plant_name == name:
       print ("Yes - ", plant_name, "is the best plant ever.")

```

This is what I have written so far.

---

<div class="post-metadata">

**Author:** ![kbjimoh](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@kbjimoh](https://forum.freecodecamp.org/u/kbjimoh)\
**Post date:** [December 13, 2021, 3:34pm UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/4 "2021-12-13T15:34:22Z")

</div>

plant\_name = str(input("Enter the plant name: "))

Sorry, this is the first line of code.

Thanks

---

<div class="post-metadata">

**Author:** ![Jagaya](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jagaya/32/202277_2.png) [@Jagaya](https://forum.freecodecamp.org/u/Jagaya)\
**Post date:** [December 13, 2021, 3:37pm UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/5 "2021-12-13T15:37:53Z")

</div>

You need an `if-elif-else`, you got the if-part down, just add an elif and else.

```auto
if num > 5:
  print("Number is bigger than 5")
elif num > 0:
  print("Number is bigger than 0 and smaller than 5")
else:
  print("Number is negative")

```

---

<div class="post-metadata">

**Author:** ![kbjimoh](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@kbjimoh](https://forum.freecodecamp.org/u/kbjimoh)\
**Post date:** [December 13, 2021, 8:08pm UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/6 "2021-12-13T20:08:36Z")

</div>

@jagaya thanks.

```auto
plant_name = str(input("Enter the plant name: "))
fruit_name = plant_name
if fruit_name is plant_name:
    print("Yes -", fruit_name, "is the best plant ever!")

```

First line achieved. Thanks to all

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [December 13, 2021, 8:15pm UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/7 "2021-12-13T20:15:37Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [June 14, 2022, 8:16am UTC](https://forum.freecodecamp.org/t/help-on-this-python-exercise/488577/8 "2022-06-14T08:16:12Z")

</div>

Closed on June 14, 2022, 8:16am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
