Python Forum
fishstore question for edx
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fishstore question for edx
#1
I get no output.
It should ask the two questions and then respond with a sentence with them

def fishstore():
    fishtype=input("What is the fish type : ")
    fishprice=input("What is the price of the fish : ")
    
    return"Fish type: ",fishtype, " costs $", str(fishprice)
fishstore()
Reply
#2
your function returns a string (good)
when you call it, you need to do something, e.g. assign value that you get from the function to a name, in order to use it later on, or you can just print, e.g.
print(fishstore())
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Program fishstore() Truman 2 5,807 Jan-12-2018, 10:44 PM
Last Post: Truman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020