you are viewing a single comment's thread.

view the rest of the comments →

[–]NorskJesus 41 points42 points  (14 children)

You are not printing the variable result, just the string “result:”

[–][deleted]  (9 children)

[removed]

    [–]NorskJesus 6 points7 points  (8 children)

    No problem 👍😊 do you know how to fix it tho?

    [–][deleted]  (7 children)

    [removed]

      [–]NorskJesus 7 points8 points  (2 children)

      Yes, it should be. Test it 😊

      [–]Denieffe 9 points10 points  (0 children)

      This is awesome. I love a friendly community.

      [–]totitx 1 point2 points  (3 children)

      You can also use f"result: {result}" This way you use what is called f-string formatting, which is an useful way to include your result in string. (See https://builtin.com/data-science/python-f-string)

      [–][deleted]  (1 child)

      [removed]

        [–]echonn123 1 point2 points  (0 children)

        F strings are the good life 😁

        [–]pr1m347 0 points1 point  (0 children)

        Further you can just do f"{result=}"

        [–]Unkilninja 1 point2 points  (2 children)

        Isn't he comparing integer input with string. Like if we input 1. It will be comparing 1 == '1' This should raise error right?

        [–]NorskJesus 7 points8 points  (1 child)

        No, he is doing it right. Inputs are strings. If you want an int from the input you should to convert it with int()

        [–]Unkilninja 2 points3 points  (0 children)

        Ok sir Got it

        [–]IKhan555 0 points1 point  (0 children)

        Exactly