🔒 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
  • 507
    Views
  • 5
    Participants
Last reply from:
zackmark29

Trending Topics

Online now

Members online
1,061
Guests online
4,764
Total visitors
5,825

Forum statistics

Threads
2,354,149
Posts
29,382,400
Members
1,079,342
Latest member
mabyloklok
Back
Top