🔒 Closed Python list

Status
Not open for further replies.

jcruze

Leecher
patulong po. hindi ko kc makuha yung value ng stocks base sa product na pipiliin ng user. sana my makatulong. need help asap. salamatScreenshot (362).webp
 
Hi. Sana if ma solve mo po yung problem, pwede pa share na lang din po dito for reference hehe Thank you
 
sir bat dika po gumamit ng dictionary? sample

product_inventory = {
"Product_1":100,
"Product_2":200
}

product = input("You want to buy?")
price = product_inventory.get(product)
print(price)
 
Yes I agree with roell21
Magiging mas easy yan kung gagamitan mo ng dictionary.
Saka much better kung papakita mo buong code para pwedeng ma-fix and ma-refactor
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 502
    Views
  • 5
    Participants
Last reply from:
zackmark29

Trending Topics

Online now

Members online
813
Guests online
2,907
Total visitors
3,720

Forum statistics

Threads
2,331,942
Posts
29,261,327
Members
1,147,909
Latest member
agboy
Back
Top