Finishing code challenges, bite-sized issues that may be solved with code, is a superb method to sharpen particular coding abilities and ideas — to not point out, code challenges are enjoyable. In honor of Delight Month this June, we’re providing you with an inventory of code challenges to attempt that every one relate to uplifting the LGBTQ+ neighborhood and its allies.
These coding challenges will provide you with mixture of Python ideas to follow, like lists, strings, conditionals, and buildings. Relying in your expertise degree, a few of these challenges solely take a couple of minutes to finish, whereas the harder ones would possibly take a pair days. Chances are you’ll wish to revisit a Python course to assessment (we’ve really helpful the related Python programs to attempt alongside the way in which).
As you’ll see, these are open-ended challenges and we’re not offering options. That’s as a result of we wish to provide you with an opportunity to follow key coding abilities and apply your coding data to real-world eventualities. We hope you’re feeling impressed by all the methods you’ll be able to use code to provide again to the communities and causes that you just care about. Joyful Delight and joyful coding!
1. Affirmation Engine
Write a Python program that takes a person’s pronouns as enter and returns a message that features their pronouns and an announcement of respect for his or her gender identification. An instance of a message could possibly be: “Thanks for sharing that your pronouns are {pronouns}. We wholeheartedly respect and affirm your gender identification, and respect your assist in constructing an inclusive atmosphere the place everybody feels valued and accepted.”
2. STEM Icons Sorter
Create a Python program that takes an inventory of LGBTQ+ historic figures as enter and returns a brand new record with the phrases sorted alphabetically. Wish to brush up in your queer historical past? Find out about trailblazing LGBTQ+ figures in our free course LGBTQ+ STEM Icons.
3. ASCII Artist
Within the beginner-friendly course Be taught Python 3, you’ll get launched to ASCII artwork, a sort of text-based visible artwork that makes use of particular person characters to create footage and diagrams. Write a Python program that prints “PRIDE” in ASCII block letters. You may reference the whole ASCII alphabet utilizing this chart.
4. Delight March Countdown
Write a Python program that calculates the variety of days, hours, and minutes remaining till the annual NYC Delight March, which begins on June 25 at 12 pm EDT. This system ought to show the countdown in a user-friendly format. For a refresher on working with date time information in Python, learn this text.
5. Acronym Explainer
Create a swap
loop that prints the phrases represented within the acronym LGBTQ+, that are: lesbian, homosexual, bisexual, transgender, queer, and non-straight/non-cisgender identities.
6. Rainbow Message Generator
You might be given a message, “Code with pleasure!” that must be reworked right into a rainbow-themed string the place every letter is a unique colour within the LGBTQ+ Delight flag. Your activity is to jot down a Python perform that takes the message as enter and returns the rainbow model of the message. Sizzling tip: You should utilize ANSI escape codes to use colour to textual content in Python.
7. Pronoun Apply Chatbot
Develop a easy chatbot that helps you follow utilizing somebody’s pronouns in numerous contexts. This code problem is probably the most superior one within the bunch, however don’t be intimidated. Within the talent path Construct Chatbots with Python, you’ll discover ways to code rule-based, retrieval-based, and generative chatbots. One of the best half is you don’t want coding expertise to get began — we’ll train you to code with Python from scratch.
8. Analysis LGBTQ+ Illustration
Construct a program that reads a dataset (you’ll be able to use this pre-made dataset) and analyzes the illustration of LGBTQ+ characters in cartoons. This system ought to calculate and show statistics, like all traits or modifications in illustration over time. When you’re new to information science, take a look at the course Getting Began with Python for Knowledge Science. You’ll get to work hands-on with actual datasets within the course, and study to make use of Jupyter Pocket book, an industry-standard information analytics platform.
Need much more Python concepts? Attempt these Python code challenges for newcomers, or work your approach as much as superior coding challenges. You too can assessment these code challenges, that are all based mostly on real-world technical interviews. When you really feel such as you’ve obtained a deal with on code challenges, you’ll want to take a look at our library of Python tasks which you could full for follow or your skilled portfolio.