Administrator

[email protected]

Total likes received: 73 | Pubby Cash: 277


Andy Tang is the creator of Gopubby.com who has a passion for programming and everything related to technology and is skilled in many areas of coding including Python, HTML/CSS, Bootstrap, and SQL. He is experienced with many Python modules including Pygame, Flask, BeautifulSoup, and Kivy. He also has a solid knowledge of Windows, Mac, and Linux/Unix operating systems.

My Articles: 48

You Think Sets Are Hard but They Actually Aren’t

Categories: General, Tech | Pubby Cash Received:  0

Similar to a list, a set is a collection that is unordered and unindexed. In Python, sets are written with curly brackets. The difference from lists is that you cannot access items in a set by referring to an index since sets are unordered the items has no index. However, you can loop through the set items using a for loop, or ask if a specified value is present in a set, by using the 'in' keyword. A Python set also resembles a dictionary because it cannot have duplicate values. This makes it easy when you want to store usernames from your website. When a user wants to create a new username, the program will first check if that username is in the set, and if not, then it will add the username to the set. One thing that surprised me was that sets were unordered. You might expect an item to be at that location when you add it but that’s not always the case. Since sets are unordered, so you cannot be sure in which order the items will appear. Unfortunately, you cannot change a value in a set, only add to it. To add one item to a set, use the ‘add()’ method. Use the ‘update()’ method to add more than one item to a set. Sets are easy to work with once you get the hang of it!...  Read more

This Data Structure Is Underrated!

Categories: General, Tech | Pubby Cash Received:  0

Let’s say that you needed to create a list of all the users that have been banned on your site. Many programmers would just use a list, and that’s just fine. They would insert a tuple containing information about the first user and the time banned, then continue with the second user and their time banned, and so on. If they want to remove a user from the list, they could either use ‘pop’ or ‘remove’. Additionally, if they want to update an item in a list, it can be very difficult because there might be multiple items with the same name. Basically, using a list isn’t the best way to go when it comes to storing lots of data that is easily accessible. So is there an even easier way? The answer is yes. Dictionaries are very beneficial in this situation because each item stored in a dictionary is unique. If you want to remove an item from a dictionary, all you have to do is find the key and delete it using the ‘del’ keyword followed by the name of the key. It’s that simple. And if you want to update an item in a dictionary, you can simply call that item using it’s key and set that to your new value. Many programmers underestimate the power of dictionaries and often turn to lists because dictionaries are just a little more confusing. But trust me, once you get the hang of dictionaries, storing data will feel like a breeze....  Read more

Is IDLE Good?

Categories: General, Tech | Pubby Cash Received:  10

It comes pre-installed with Python, but many coders just ignore it. Is IDLE worth your time? Well, if you’re a beginner, IDLE would be a great start for you. Although it has just the bare bones, the best place to experiment with Python code is in the interactive interpreter, otherwise known as a shell. The shell is a basic Read-Eval-Print Loop (REPL). It reads a Python statement, evaluates the result of that statement, and then prints the result on the screen. Then, it loops back to read the next statement. The Python shell is an excellent place to experiment with small code snippets. You can access it through the terminal or command line app on your machine, however, all of the text will be a single color and it will be hard to understand the outputs. You can simplify your workflow with Python IDLE, which will immediately start a Python shell when you open it. IDLE will automatically highlight the keywords and other python commands so you will know without a doubt what you are looking for. Every programmer needs to be able to edit and save text files. Python programs are files with the .py extension that contain lines of Python code. Python IDLE gives you the ability to create and edit these files with ease. Python IDLE also provides several useful features that you’ll see in professional IDEs, like basic syntax highlighting, code completion, and auto-indentation. Professional IDEs are more robust pieces of software and they have a steep learning curve. If you’re just beginning your Python programming journey, then Python IDLE is a great alternative!...  Read more

The Ultimate Coding Experience

Categories: General, Tech | Pubby Cash Received:  0

Many programmers struggle with reading their code because they don’t have the right font. That’s right, just the shape of some letters could throw at you a super annoying bug that will take two hours to fix. Especially when it comes to the shapes of the letter “O” and the number “0”. They’re both round, and sometimes, it can be very difficult to tell them apart. That’s why you need the correct font that will make you instantly tell the difference between those two. Menlo Regular is an excellent font in this situation. It is very easy to tell the difference between the zero and the ‘O’ because there is a slash in the zero. All of the characters are extremely easy to read and the letters line up when you are doing some serious coding because it is a monospaced font. That means that each character takes up one space. When it comes to indentations and precision coding, monospaced fonts are the way to go. Other good choices include Consolas, Courier, Lucida Console, Monaco, and Inconsolata. Choose your favorite and you’ll be on your way to an exciting coding experience!...  Read more

GoPubby Update

Categories: News | Pubby Cash Received:  0

GoPubby.com just announced the release of 20 new unique badges which can be earned and displayed on your home page. While some are easier to earn than others, all of the tasks that Pubbies would take to earn those badges are possible. Let’s just briefly mention some of those badges. The easiest badge to earn is the Novice badge. All you need to do is post an article to earn this badge. There are many hard badges to earn, such as the A-Gang badge. To earn this one, you would have to be promoted to Moderator. Currently, these badges are just for show, but we might place a value on each badge so you would get a certain amount of Pubby Cash when you earn a new badge. We are also planning on adding a customer shop with items that can be purchased with your Pubby Cash. Possible items include lottery tickets and status upgrades at the moment. With the shop in place, you could actually put your well-earned Pubby Cash to good use! Stay tuned for further details regarding these changes....  Read more

1 ... 6 7 8 ... 10

Daily Deals


MECHANICSBURG WEATHER