Top python stuff of the week![27th July]
Here are the hottest python blog posts and publications of the week👇
Here are the hottest python projects and Github repos of the week👇
A python discord bot which will quiz you on quotes from the “friends” tv show
A simple yet addictive python game made using the pygame library
A simple whatsapp bot in python (blog post explaining how to make your own: https://apoorvtyagi.tech/how-i-automated-my-whatsapp-chats)
2D Minecraft Game Made With python using the pygame library (Beta)
A python project that turns digital images into mosaics made of Minecraft blocks.
Some trending pip packages 👇
A library for creating and manipulating PDF files in python.
A command-line tool that can draw graphs in the terminal, written in Python.
And to top it off, here are three python tips👇
1. When trying to merge 2 dictionaries together to make a larger collection of data, you can make it easy by using the “**” operator in python.
d1={"A": 50, "B": 60, "C": 90}
d2={"X": 120, "Y": 190, "Z": 320}
d3={**d1, **d2}
print(d3) #output: {'A': 50, 'B': 60, 'C': 90, 'X': 120, 'Y': 190, 'Z': 320}
2. When trying to compare multiple numbers to each other, instead of doing something along the lines of:
distance = 100
checker = 50 < distance
checker = checker < 250
print(checker) #output: True
you should rather do the same but using the simpler chain method:
distance = 100
checker = 50 < distance < 250
print(checker) #output: True
3. When trying to break up a string into shorter substrings, you can simply use the split method:
str = "Hello World"
a = str.split(" ")
print(a) #output: ['Hello', 'World']
you can also break up a string into substrings if they are separated by certain characters like commas:
str = "Hello,World"
a = str.split(",")
print(a) #output: ['Hello', 'World']
This might come in handy when trying to break up a long sentence into individual words:
str = "I'm a python programmer who likes making new projects"
a = str.split(" ")
print(a) #output: ["I'm", 'a', 'python', 'programmer', 'who', 'likes', 'making', 'new', 'projects']
That’s it for now.