Nov-08-2017, 04:45 AM (This post was last modified: Nov-08-2017, 04:45 AM by Prrz.) Hello Python Forum, as a learning experience I created a very basic 'Slot' machine. It's far from perfect and could definitely use many upgrades, more winning options, pay tables, etc. As for this project I was mostly focusing on functionality, and I may continue working on it from time to time to make it better (more interesting to play). That's all for now, please tell me what you think! Any suggestions, comments, criticism: All is welcome! Thank you, Prrz Nov-09-2017, 03:14 PM Now you should learn tkinter for a simple GUI. Nov-21-2017, 03:03 AM (Nov-09-2017, 03:14 PM)heiner55 Wrote: Now you should learn tkinter for a simple GUI. Thanks for your reply, I'm not sure I'll be tinkering with GUI just yet but I hope it will be in my future! I've still much to learn before I take that leap. Nov-26-2017, 01:46 PM OK, we are waiting. |
I'd say you should encapsulate as much of your code as possible into functions and classes, limiting the global state when possible. This serves two purposes - the first is that it improves debugging (by limiting the odds that something unintentionally alters global state) and readability (by making it easier to understand what everything does). Definition and Usage. The rpartition method searches for the last occurrence of a specified string, and splits the string into a tuple containing three elements. The first element contains the part before the specified string.
Python Fruit Machine For Sale
Hi, i was working on a code for a vending machine and i do consider myself to be a beginner, anyway i feel my code is much longer than it needs to be and i want someone to show me a new, shorter way of presenting it.
Thanks.
- 5 Contributors
- forum5 Replies
- 12,867 Views
- 2 Years Discussion Span
- commentLatest PostLatest Postby Reverend Jim
Recommended Answers
Fruit Machine Code Python
Before making any suggestions, I would like to ask if your course of study (whether personal or formal) has gotten to functions and how to write them yet. This would be a big factor in how you approach thsis matter.
Python Fruit Machine Games
The first thing is to never have variable names containing a variable index, such as product_1, product_2,
etc. Use lists or tuples instead
Then product[0]
is …
All 5 Replies
Recommended Answers
Fruit Machine Code Python
Before making any suggestions, I would like to ask if your course of study (whether personal or formal) has gotten to functions and how to write them yet. This would be a big factor in how you approach thsis matter.
Python Fruit Machine Games
Jump to PostThe first thing is to never have variable names containing a variable index, such as product_1, product_2,
etc. Use lists or tuples instead
Then product[0]
is …
All 5 Replies
Before making any suggestions, I would like to ask if your course of study (whether personal or formal) has gotten to functions and how to write them yet. This would be a big factor in how you approach thsis matter.