Title: Nhóm4-NMLP · Issue #175 · ActiveState/code · GitHub
Open Graph Title: Nhóm4-NMLP · Issue #175 · ActiveState/code
X Title: Nhóm4-NMLP · Issue #175 · ActiveState/code
Description: lass Product: def init(self, name, price, stock): self.name = name self.stock = stock def __str__(self): return f"{self.name} - Giá: {self.price} VND, Tồn kho: {self.stock}" class VendingMachine: def init(self): self.products = [ Product...
Open Graph Description: lass Product: def init(self, name, price, stock): self.name = name self.stock = stock def __str__(self): return f"{self.name} - Giá: {self.price} VND, Tồn kho: {self.stock}" class VendingMachine: d...
X Description: lass Product: def init(self, name, price, stock): self.name = name self.stock = stock def __str__(self): return f"{self.name} - Giá: {self.price} VND, Tồn kho: {self.stock}" class Vending...
Opengraph URL: https://github.com/ActiveState/code/issues/175
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Nhóm4-NMLP","articleBody":"lass Product: \n def __init__(self, name, price, stock): \n self.name = name \n self.stock = stock \n \n def __str__(self): \n return f\"{self.name} - Giá: {self.price} VND, Tồn kho: {self.stock}\"\n \nclass VendingMachine: \n def __init__(self): \n self.products = [\n Product(\"Mì Gói Siu Cay\", 19000, 14),\n Product(\"Coca Cola\", 15000, 10),\n Product(\"Snack\", 12000, 12), \n Product(\"Nước suối\", 5000, 20),\n Product(\"Sữa MILO\", 12000, 15),\n ]\n self.balance = 500000 \n def show_menu(self): \n print(\"\\nMenu sản phẩm:\") \n for index, product in enumerate(self.products): \n print(f\"{index + 1}. {product}\") \n print(f\"số tiền còn lại: {self.balance} VND\") \n def buy_product(self, choice): \n if 1 \u003c= choice \u003c= len(self.products): \n product = self.products[choice - 1] \n if product.stock \u003e 0: \n if self.balance \u003e= product.price: \n self.balance -= product.price \n product.stock -= 1 \n print(f\"\\nMua {product.name} thành công!\") \n print(f\"Tiền còn lại: {self.balance} VND\") \n print(f\"Tồn kho {product.name} còn lại: {product.stock}\") \n else: \n print(\"\\nLỗi: Bạn không đủ tiền để mua sản phẩm này!\") \n else: \n print(\"\\nLỗi: Sản phẩm đã hết hàng!\") \n else: \n print(\"\\nLỗi: Lựa chọn không hợp lệ!\") \n def run(self): \n while True: \n self.show_menu() \n try: \n choice = int(input(\"\\nChọn sản phẩm để mua (hoặc nhập 0 để thoát): \")) \n if choice == 0: \n print(\"\\nCảm ơn bạn đã sử dụng máy bán hàng!\") \n break \n else: \n self.buy_product(choice) \n except ValueError: \n print(\"\\nLỗi: Vui lòng nhập một số hợp lệ!\") \n \n\nif __name__ == \"__main__\": \n\n vending_machine = VendingMachine() \n\n vending_machine.run() ","author":{"url":"https://github.com/thanhtuyentv0101-blip","@type":"Person","name":"thanhtuyentv0101-blip"},"datePublished":"2025-12-16T18:57:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/175/code/issues/175"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:96a767b6-ae9b-45c1-edb9-df5dbb16c0e9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 950C:406C5:4E0354:6A951C:6969602C |
| html-safe-nonce | 7953bc407eb1ae501e3f7427a78508569c22e4ca560fa26832189a4228cd5713 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTBDOjQwNkM1OjRFMDM1NDo2QTk1MUM6Njk2OTYwMkMiLCJ2aXNpdG9yX2lkIjoiNDU5MzEzMzgxMDE3NjU4MTY3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7358ed2a8c2e18a0a2175596b1b7aeebeb5d7602d727fae8d991905eec37105b |
| hovercard-subject-tag | issue:3735966658 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ActiveState/code/175/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0e52ec6930b408f50d7ad8d8d9b3b9ea8f4f1ed631b830117ecb1734913dae4/ActiveState/code/issues/175 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0e52ec6930b408f50d7ad8d8d9b3b9ea8f4f1ed631b830117ecb1734913dae4/ActiveState/code/issues/175 |
| og:image:alt | lass Product: def init(self, name, price, stock): self.name = name self.stock = stock def __str__(self): return f"{self.name} - Giá: {self.price} VND, Tồn kho: {self.stock}" class VendingMachine: d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | thanhtuyentv0101-blip |
| hostname | github.com |
| expected-hostname | github.com |
| None | 48487c1ad776a7975b7132d95f4240ff3ae37cd5b8e3cb597102a4edb76738f1 |
| turbo-cache-control | no-preview |
| go-import | github.com/ActiveState/code git https://github.com/ActiveState/code.git |
| octolytics-dimension-user_id | 319781 |
| octolytics-dimension-user_login | ActiveState |
| octolytics-dimension-repository_id | 98225960 |
| octolytics-dimension-repository_nwo | ActiveState/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 98225960 |
| octolytics-dimension-repository_network_root_nwo | ActiveState/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 669463fcc54773a88c1f5a44eef6b99a5504b9c7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width