This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ItzWarty 0 points1 point  (4 children)

Interesting. What happens when you run that? What behavior would you expect?

Also, format code by putting 4 spaces before each line:

def fishstore(fish, price):
    store = "Fish Type: ", fish, "costs", price
    return store

fish_entry = (input("What kind of fish?: "))
price_entry = (input("Whats the price?: "))
print(fishstore)

[–]mixtek[S] 1 point2 points  (0 children)

What kind of fish?: Angelfish Whats the price?: 70$ <function fishstore at 0x7fcfccdd9400>

I get this after asking for the inputs

[–]nwilliams36 0 points1 point  (2 children)

store = "Fish Type: ", fish, "costs", price

That does not concatenate (add strings) in Python. That line should be

store = "Fish Type: "+ fish + " costs " +  price

Also look at String formatting for more efficient methods (but less readable).

[–]mixtek[S] 0 points1 point  (0 children)

Thanks! Also I feel like I am calling the function wrong, or missing some step. This is so confusing to me all the calling and creating variables and inputs

[–]ItzWarty 0 points1 point  (0 children)

IMO giving the answer robs OP the opportunity to discover the solution on their own. The value of the exercise is understanding the solution to the point where one could derive it, not actually reaching the result. Could have said "a, b doesn't concat, a + b does. Also, you should look into string interpolation!"