0

8 Python Code Challenges to Try During Pride

 1 year ago
source link: https://www.codecademy.com/resources/blog/python-code-challenges-lgbtq-pride/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Pride-Day_R1_Blog2.webp

8 Python Code Challenges to Try During Pride

06/01/2023
4 minutes

Completing code challenges, bite-sized problems that can be solved with code, is an excellent way to sharpen specific coding skills and concepts — not to mention, code challenges are fun. In honor of Pride Month this June, we’re giving you a list of code challenges to try that all relate to uplifting the LGBTQ+ community and its allies. 

These coding challenges will give you a good mix of Python concepts to practice, like lists, strings, conditionals, and structures. Depending on your experience level, some of these challenges only take a few minutes to complete, while the more difficult ones might take a couple days. You may want to revisit a Python course to review (we’ve recommended the relevant Python courses to try along the way). 

As you’ll see, these are open-ended challenges and we’re not providing solutions. That’s because we want to give you a chance to practice key coding skills and apply your coding knowledge to real-world scenarios. We hope you feel inspired by all of the ways you can use code to give back to the communities and causes that you care about. Happy Pride and happy coding!

1. Affirmation Engine

Write a Python program that takes a user’s pronouns as input and returns a message that includes their pronouns and a statement of respect for their gender identity. An example of a message could be: “Thank you for sharing that your pronouns are {pronouns}. We wholeheartedly respect and affirm your gender identity, and appreciate your help in building an inclusive environment where everyone feels valued and accepted.

2. STEM Icons Sorter

Create a Python program that takes a list of LGBTQ+ historical figures as input and returns a new list with the terms sorted alphabetically. Want to brush up on your queer history? Learn about trailblazing LGBTQ+ figures in our free course LGBTQ+ STEM Icons.

3. ASCII Artist

In the beginner-friendly course Learn Python 3, you’ll get introduced to ASCII art, a type of text-based visual art that uses individual characters to create pictures and diagrams. Write a Python program that prints “PRIDE” in ASCII block letters. You can reference the complete ASCII alphabet using this chart.

4. Pride March Countdown

Write a Python program that calculates the number of days, hours, and minutes remaining until the annual NYC Pride March, which starts on June 25 at 12 pm EDT. The program should display the countdown in a user-friendly format. For a refresher on working with date time data in Python, read this article

5. Acronym Explainer

Create a switch loop that prints the terms represented in the acronym LGBTQ+, which are: lesbian, gay, bisexual, transgender, queer, and non-straight/non-cisgender identities.

6. Rainbow Message Generator

You are given a message, “Code with pride!” that needs to be transformed into a rainbow-themed string where each letter is a different color in the LGBTQ+ Pride flag. Your task is to write a Python function that takes the message as input and returns the rainbow version of the message. Hot tip: You can use ANSI escape codes to apply color to text in Python.

7. Pronoun Practice Chatbot

Develop a simple chatbot that helps you practice using someone’s pronouns in different contexts. This code challenge is the most advanced one in the bunch, but don’t be intimidated. In the skill path Build Chatbots with Python, you’ll learn how to code rule-based, retrieval-based, and generative chatbots. The best part is you don’t need coding experience to get started — we’ll teach you to code with Python from scratch. 

8. Research LGBTQ+ Representation

Build a program that reads a dataset (you can use this pre-made dataset) and analyzes the representation of LGBTQ+ characters in cartoons. The program should calculate and display statistics, like any trends or changes in representation over the years. If you’re new to data science, check out the course Getting Started with Python for Data Science. You’ll get to work hands-on with real datasets in the course, and learn to use Jupyter Notebook, an industry-standard data analytics platform.

Want even more Python ideas? Try these Python code challenges for beginners, or work your way up to advanced coding challenges. You can also review these code challenges, which are all based on real-world technical interviews. If you feel like you’ve got a handle on code challenges, be sure to check out our library of Python projects that you can complete for practice or your professional portfolio.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK