<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sonny Li</title>
    <description>The latest articles on DEV Community by Sonny Li (@sonnynomnom).</description>
    <link>https://dev.to/sonnynomnom</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F123215%2Fda49b124-5a84-46aa-bb1d-17d1e916c55d.png</url>
      <title>DEV Community: Sonny Li</title>
      <link>https://dev.to/sonnynomnom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sonnynomnom"/>
    <language>en</language>
    <item>
      <title>Monthly Challenge #4: Valentine's Day 💘</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Thu, 09 Feb 2023 19:08:57 +0000</pubDate>
      <link>https://dev.to/codedex/monthly-challenge-4-valentines-day-2o1g</link>
      <guid>https://dev.to/codedex/monthly-challenge-4-valentines-day-2o1g</guid>
      <description>&lt;p&gt;What better way to celebrate Valentine's Day than by sharing a poem with your friends and family? In this challenge, you will create a poem on a web page using HTML. 💌&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a combination of at least five common HTML elements, such as headings, paragraphs, lists, and text formatting.&lt;/li&gt;
&lt;li&gt;The poem can take on any form you like! You can freestyle with as many lines as your heart desires, but here are some suggestions for common poem types:

&lt;ul&gt;
&lt;li&gt;Sonnet (14 lines)&lt;/li&gt;
&lt;li&gt;Haiku (3 lines; 5 syllable, 3 syllables, 5 syllables, respectively)&lt;/li&gt;
&lt;li&gt;Limerick (5 lines; rhyme scheme AABAB)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Bonus:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make your Valentine's Day poem as pretty or complex in style (background color, border, etc.) by doing one of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; element in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of the document.&lt;/li&gt;
&lt;li&gt;Apply a global style attribute to various elements in the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; of the document.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="//www.codedex.io/html"&gt;Try our free course&lt;/a&gt; if you need a quick refresher on HTML!&lt;/p&gt;

&lt;p&gt;Submit a screenshot of your web page by Feb 14th for a chance to win a special surprise! If you want, you can tag the person the valentine is for so they can see it.&lt;/p&gt;

&lt;p&gt;May the best poet win. 💕&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>html</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Monthly Challenge #3: Morse Code 🆘</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Mon, 02 Jan 2023 22:06:09 +0000</pubDate>
      <link>https://dev.to/codedex/monthly-challenge-3-morse-code-4d97</link>
      <guid>https://dev.to/codedex/monthly-challenge-3-morse-code-4d97</guid>
      <description>&lt;h3&gt;
  
  
  Morse Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Morse_code" rel="noopener noreferrer"&gt;Morse code&lt;/a&gt; is a communication method to encode characters as dots (.) and dashes (-), developed in the 1830s.&lt;/p&gt;

&lt;h3&gt;
  
  
  January Challenge
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;translate()&lt;/code&gt; Python function that takes in a message and converts it to morse code. &lt;/p&gt;

&lt;p&gt;Post the code/output screenshot in the Twitter thread by Jan 14th for a chance to win a Codédex hoodie! 🎁&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1609910099824496647-936" src="https://platform.twitter.com/embed/Tweet.html?id=1609910099824496647"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1609910099824496647-936');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1609910099824496647&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
      <category>devmeme</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>Monthly Challenge #2: Holiday ASCII Art ️ ️☃️</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Thu, 01 Dec 2022 18:10:39 +0000</pubDate>
      <link>https://dev.to/codedex/monthly-twitter-challenge-holiday-ascii-art-lbl</link>
      <guid>https://dev.to/codedex/monthly-twitter-challenge-holiday-ascii-art-lbl</guid>
      <description>&lt;p&gt;Welcome to Codédex's second Monthly Twitter Challenge! This one is also created by our SWE Intern, &lt;a class="mentioned-user" href="https://dev.to/asiqurrahman"&gt;@asiqurrahman&lt;/a&gt;. 🙌&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1598365914134679552-665" src="https://platform.twitter.com/embed/Tweet.html?id=1598365914134679552"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1598365914134679552-665');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1598365914134679552&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ASCII Art:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/ASCII_art" rel="noopener noreferrer"&gt;ASCII art&lt;/a&gt; is a computer graphic design technique that piece together a picture using characters defined by the ASCII Standard from 1963.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using your coding language of choice, create a holiday-themed ASCII art in the terminal. Be as creative as you can. And it has to be original! 🎅🏼🎄☃️❄️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleb1hye3yp0krwaizl0i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleb1hye3yp0krwaizl0i.gif" alt="GIF" width="529" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Post your code &amp;amp; screenshot below by Dec 14th for a chance to win a limited edition Codédex sweater mailed to your door by Christmas morning! 🎁&lt;/p&gt;

</description>
      <category>programming</category>
      <category>challenge</category>
      <category>beginners</category>
      <category>codedex</category>
    </item>
    <item>
      <title>Codédex Launch on Product Hunt! 🚀</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Mon, 07 Nov 2022 12:01:08 +0000</pubDate>
      <link>https://dev.to/codedex/codedex-launch-on-product-hunt-13o8</link>
      <guid>https://dev.to/codedex/codedex-launch-on-product-hunt-13o8</guid>
      <description>&lt;p&gt;Hi Devs!&lt;/p&gt;

&lt;p&gt;It’s Sonny from &lt;a href="https://www.codedex.io"&gt;Codédex&lt;/a&gt; –– a brand new learn to code platform for Gen Z. &lt;/p&gt;

&lt;p&gt;We’re a small-but-mighty team based in Brooklyn, NY but have teammates across the globe.&lt;/p&gt;

&lt;p&gt;Since June 2022, we’ve gone full in on our mission to empower the next generation of builders and dreamers. And today, we are finally launching to the world on Product Hunt — please support us!&lt;/p&gt;

&lt;p&gt;Head over to Product Hunt to give us an upvote! We are aiming for the Top 5 Products of the Day and it would mean the world if you can give us 30 seconds of your time.&lt;/p&gt;

&lt;p&gt;⬆️ &lt;a href="https://www.producthunt.com/posts/codedex"&gt;https://www.producthunt.com/posts/codedex&lt;/a&gt; ⬆️&lt;/p&gt;

&lt;p&gt;Here's a preview of the site:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I7Karbhm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwqrfddamlfs0bxk392i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I7Karbhm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwqrfddamlfs0bxk392i.gif" alt="Home page GIF" width="880" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, huge shoutout out to the whole team: Dharma, Malcolm, Asiqur, Jerry, Rose, and Lil for working on this night and day for the past few months. LFG team!&lt;/p&gt;

&lt;p&gt;Happy coding,&lt;br&gt;
Sonny 🤠&lt;/p&gt;

</description>
      <category>news</category>
      <category>startup</category>
      <category>codenewbie</category>
      <category>python</category>
    </item>
    <item>
      <title>How do programmers say "I love you"? 🤔</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Thu, 03 Nov 2022 16:04:42 +0000</pubDate>
      <link>https://dev.to/codedex/how-do-programmers-say-i-love-you-4e27</link>
      <guid>https://dev.to/codedex/how-do-programmers-say-i-love-you-4e27</guid>
      <description>&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; WRONG answers only! &lt;/p&gt;

&lt;p&gt;Feel free to reply in the comments or in the Twitter thread:&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--dH3PEO97--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1523772807544512513/C-ckSsu3_normal.jpg" alt="Codédex profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Codédex
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @codedex_io
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      How do programmers say "I love you"? 🤔&lt;br&gt;Wrong answers only.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      00:16 AM - 03 Nov 2022
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1587961941359730688" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1587961941359730688" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1587961941359730688" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;That's all! Happy Thursday, Devs! 💖&lt;/p&gt;

</description>
      <category>programming</category>
      <category>codenewbie</category>
      <category>codedex</category>
    </item>
    <item>
      <title>Monthly Challenge #1: Palindrome 🔤</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Tue, 01 Nov 2022 16:39:08 +0000</pubDate>
      <link>https://dev.to/codedex/monthly-twitter-challenge-1-palindrome-3hg6</link>
      <guid>https://dev.to/codedex/monthly-twitter-challenge-1-palindrome-3hg6</guid>
      <description>&lt;p&gt;Welcome to Codédex's first ever Monthly Twitter Challenge! This one is created by our SWE Intern, &lt;a class="mentioned-user" href="https://dev.to/asiqurrahman"&gt;@asiqurrahman&lt;/a&gt;. 🙌&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1587072993448058883-356" src="https://platform.twitter.com/embed/Tweet.html?id=1587072993448058883"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1587072993448058883-356');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1587072993448058883&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Palindrome:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;A word, sentence, or number that reads the same forward or backward (e.g., &lt;em&gt;racecar&lt;/em&gt;, &lt;em&gt;civic&lt;/em&gt;, and &lt;em&gt;121&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a Python function that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Takes in a string as a parameter.&lt;/li&gt;
&lt;li&gt;Checks if it's a palindrome.&lt;/li&gt;
&lt;li&gt;Returns &lt;code&gt;True&lt;/code&gt; if it is or &lt;code&gt;False&lt;/code&gt; if it's not.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📦 Don’t use any packages.&lt;/li&gt;
&lt;li&gt;💬 Make sure to comment the code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Post your program screenshot in the &lt;a href="https://twitter.com/codedex_io/status/1587072993448058883"&gt;Twitter thread&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;And we will pick a random winner by noon this Friday. The prize is a free &lt;a href="https://codedex.myshopify.com"&gt;Codédex tee&lt;/a&gt; and bragging rights! 🏆&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We have a winner to the Codédex Monthly Challenge: Palindrome! 🥁...&lt;/p&gt;

&lt;p&gt;Congrats to Michael Gonzalez! 🇪🇨 &lt;/p&gt;

&lt;p&gt;The reasons being:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solution covers string &amp;amp; number&lt;/li&gt;
&lt;li&gt;Good comments&lt;/li&gt;
&lt;li&gt;Good breakdown of the functions&lt;/li&gt;
&lt;li&gt;First to post bonus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the solution: &lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1587105952607703040-740" src="https://platform.twitter.com/embed/Tweet.html?id=1587105952607703040"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1587105952607703040-740');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1587105952607703040&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
      <category>python</category>
      <category>challenge</category>
      <category>beginners</category>
      <category>codedex</category>
    </item>
    <item>
      <title>Build a Discord Bot with Python</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Thu, 01 Sep 2022 20:13:27 +0000</pubDate>
      <link>https://dev.to/codedex/build-a-discord-bot-with-python-1lm3</link>
      <guid>https://dev.to/codedex/build-a-discord-bot-with-python-1lm3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt; Python fundamentals&lt;br&gt;
&lt;strong&gt;Versions:&lt;/strong&gt; Python 3.10&lt;br&gt;
&lt;strong&gt;Read Time:&lt;/strong&gt; 45 minutes&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we'll learn how to set up your Python programming environment, create and register a bot using &lt;a href="https://discord.com/developers/" rel="noopener noreferrer"&gt;Discord Developer Portal&lt;/a&gt;, and write a few lines of Python code to respond to users' messages in Discord. We'll also provide a breakdown of each line of code for those who want to get a deeper understanding of how it all works.&lt;/p&gt;

&lt;p&gt;The Discord bot that we are going to build will listen for the keyword &lt;code&gt;$meme&lt;/code&gt; and responds with a random meme from Reddit. &lt;/p&gt;

&lt;p&gt;The final result will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fcodedex-io%2Fprojects%2Fmain%2Fprojects%2Fbuild-a-discord-bot-with-python%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fcodedex-io%2Fprojects%2Fmain%2Fprojects%2Fbuild-a-discord-bot-with-python%2Fdemo.gif" alt="Example meme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's dive in!&lt;/p&gt;
&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;Before we get started, you will need a few things if you don't have them already:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;Python 3&lt;/a&gt; installed.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pip.pypa.io/en/stable/installation/" rel="noopener noreferrer"&gt;pip&lt;/a&gt; (package installer) installed.&lt;/li&gt;
&lt;li&gt;A Discord account.&lt;/li&gt;
&lt;li&gt;A Discord server with "Manager Server" permissions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  How Does a Discord Bot Work
&lt;/h2&gt;

&lt;p&gt;First, let's zoom out a bit and think about this question: "What does it mean to code a Discord Bot?" Simply put, a bot is nothing more than a computer program that performs some useful actions. &lt;/p&gt;

&lt;p&gt;Because Discord wants bots to be able to do useful things, they have allowed developers to access parts of its system in their code, such as automatically responding to messages or helping with the server's admin functions (e.g. check out these &lt;a href="https://top.gg/list/top" rel="noopener noreferrer"&gt;popular Discord Bots&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;Today, we're focused on getting our bot to read and write messages, so let's see how that works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fcodedex-io%2Fprojects%2Fmain%2Fprojects%2Fbuild-a-discord-bot-with-python%2Fsketch.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fcodedex-io%2Fprojects%2Fmain%2Fprojects%2Fbuild-a-discord-bot-with-python%2Fsketch.png" alt="Drawing of server diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the crude drawing above (I'm an engineer, not an artist), we can see how users and bots connect to the Discord backend. Each user interacts with the Discord backend to write and read messages. Then, the Discord backend servers will broadcast an event to any program listening that a new message has been posted. All we have to do is write our program to respond to message events (named &lt;strong&gt;bot.py&lt;/strong&gt; here) and connect it to the Discord backend by using their API.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;API (Application Programming Interface) is just a fancy terminology to define how one program talks to another program. In our case, Discord's API allows us to read and send messages to its backend servers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;First, we'll have to create and register our bot from Discord's Developer Portal.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up Discord Developer Portal
&lt;/h2&gt;

&lt;p&gt;We'll be creating and registering our Discord Application inside the Developer Portal. Then, we will create a Bot for the application and get the required permissions.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1. Go to Developer Portal
&lt;/h3&gt;

&lt;p&gt;Visit &lt;a href="https://discord.com/developers/applications" rel="noopener noreferrer"&gt;https://discord.com/developers/applications&lt;/a&gt; and sign in if you haven't already.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2. Create a New Application
&lt;/h3&gt;

&lt;p&gt;To let Discord know we're going to be connecting to their backend servers, we need to register an application and set up the required permissions. &lt;/p&gt;

&lt;p&gt;Click "New Application" on the top right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FpvjFmDB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FpvjFmDB.png" alt="Create Application"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, give your application a name. Here, we are calling ours MemeBot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FIXbC5RB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FIXbC5RB.png" alt="Create new bot"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3. Add a Bot to Your Application
&lt;/h3&gt;

&lt;p&gt;Find the "Bot" tab in the left panel:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FF2t6hQh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FF2t6hQh.png" alt="Add Bot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And click "Add Bot":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FMGGg2bP.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FMGGg2bP.png" alt="Add Bot 2"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4. Get the Token for Your Application
&lt;/h3&gt;

&lt;p&gt;This step is important because we'll need this Token for later. This Token is similar to a password for your application. Anybody who has this can control it. (So make sure to never share your bot token with anyone, or upload it on GitHub by mistake!)&lt;/p&gt;

&lt;p&gt;Click "Reset Token", write it down somewhere safe and definitely don't put it in any public place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FdJ3OhpB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FdJ3OhpB.png" alt="Reset Token"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 5. Invite Application to Your Server
&lt;/h3&gt;

&lt;p&gt;Now that we've set up our first application, we have to create an invite, to get our bot into our Discord server. To do that we can click URL Generator and select the following permissions. In the screenshot below, we are telling Discord to create an invitation link for our application with the scope "Bot" and that bot should be able to "Send Messages." (Note: Be careful with granting the all-powerful "Administrator" permission to your bot).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FFAwczVR.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FFAwczVR.png" alt="set up permissions"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FZyDCKhl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FZyDCKhl.png" alt="get the invite link"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the link to invite our application (Discord bot) into a Discord server. Copy and paste this link into another tab in your browser and invite the bot into the Discord server that you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FS5zVxzP.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FS5zVxzP.png" alt="invite the bot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can confirm if this worked by checking for this message in your Discord server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FJRlzfIS.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FJRlzfIS.png" alt="invite success"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alright, now that we’ve set up our coding environment and got the necessary permissions from Discord for our new application, let’s write some code.&lt;/p&gt;
&lt;h2&gt;
  
  
  Writing the Python Code
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Installing discord.py
&lt;/h3&gt;

&lt;p&gt;The code that we will write, will be responsible for the creation of the bot that will connect to the Discord backend using Discord APIs.&lt;/p&gt;

&lt;p&gt;The complicated part about writing this program is how we're going to interact with the Discord API. While we can read the &lt;a href="https://discord.com/developers/docs/intro" rel="noopener noreferrer"&gt;API documentation&lt;/a&gt; and send HTTP requests directly to Discord, we have an easier way.&lt;/p&gt;

&lt;p&gt;We'll be using a Python package called &lt;a href="https://discordpy.readthedocs.io/en/stable/" rel="noopener noreferrer"&gt;discord.py&lt;/a&gt; which is a simple wrapper around the Discord API. A wrapper provides a way to access an API through a particular programming language, in this case, Python!&lt;/p&gt;

&lt;p&gt;If you are using Mac, run the following command in the Terminal to install it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-U&lt;/span&gt; discord.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are using Windows, then the following command should be used instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;py &lt;span class="nt"&gt;-3&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-U&lt;/span&gt; discord.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What did we just do here? We just installed a Python package from &lt;a href="https://pypi.org/project/pip" rel="noopener noreferrer"&gt;pip&lt;/a&gt; the package installer, which is just another way of saying we downloaded code that someone kindly wrote and uploaded to a public repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Log Into the Discord Server with the Bot
&lt;/h3&gt;

&lt;p&gt;Let’s create a new file called &lt;strong&gt;bot.py&lt;/strong&gt; in a new directory. This is the main file where we'll code the logic to make our Discord bot. Now paste the following code into it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;discord&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;discord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Logged on as {0}!&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Your Token Here&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Replace with your own token.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s go over this block of code line by line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;discord&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;discord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Logged on as {0}!&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First, we've imported the &lt;code&gt;discord.py&lt;/code&gt; package that we just installed and created our own class &lt;code&gt;MyClient&lt;/code&gt; which we will use to interact with the Discord API. We create this class by extending from the base class &lt;code&gt;discord.Client&lt;/code&gt;. This base class already has methods to respond to common events. For example, the &lt;code&gt;on_ready()&lt;/code&gt; function above will be called when the Discord bot's login is successful.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;discord.py&lt;/code&gt; works around the concept of events. There are other types of events (e.g. messages) that we will see later, but for now here's the definition of events from their website:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An event is something you listen to and then respond to. For example, when a message happens, you will receive an event about it that you can respond to.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Finally, our last two lines of code instantiates the &lt;code&gt;MyClient&lt;/code&gt; class and calls &lt;code&gt;run&lt;/code&gt;, which is the main way to start the client. The client will use the given token (which you should have saved from before) to authenticate itself to the Discord backend servers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Your Token Here&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Replace with your own token
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Running the Bot
&lt;/h3&gt;

&lt;p&gt;You can run this code by typing in the following in your terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 bot.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As long as you keep this program running, your Discord bot will be online.&lt;/p&gt;

&lt;p&gt;If you see this output in your terminal, then your Discord bot has successfully logged into your Discord server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Logged on as MemeBot#3995!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Responding to Messages
&lt;/h3&gt;

&lt;p&gt;Next, we want our bot to read messages in a Discord channel and respond to them.&lt;/p&gt;

&lt;p&gt;Add the &lt;code&gt;.on_message()&lt;/code&gt; method to the &lt;code&gt;MyClient&lt;/code&gt; class like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$hello&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Hello World!&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.on_message()&lt;/code&gt; method gets called automatically anytime there is a new message in a channel where our bot is located. In our method:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are first checking &lt;code&gt;if message.author == self.user&lt;/code&gt;, if the bot is the one sending the message in the chat. We don’t want the bot to keep responding to its own messages.&lt;/li&gt;
&lt;li&gt;Then, we have some code to respond to a special keyword &lt;code&gt;$hello&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's try it out. Run the command &lt;code&gt;python3 bot.py&lt;/code&gt; to start our program.&lt;/p&gt;

&lt;p&gt;Now, add Memebot to any channel and type the word &lt;code&gt;$hello&lt;/code&gt; in that channel and see what happens:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FGMfqJ8g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgur.com%2FGMfqJ8g.png" alt="Discord example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We've successfully programmed our bot to log into Discord and respond to our messages. But can we go further?&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Respond with Memes
&lt;/h2&gt;

&lt;p&gt;What if instead of responding with a text message, the bot responds with memes? Well that sounds like a lot of work.. buuut the cool thing about programming is that we can reuse other people’s work (yay for open source).&lt;/p&gt;

&lt;p&gt;Check out this Github repository: &lt;a href="https://github.com/D3vd/Meme_Api" rel="noopener noreferrer"&gt;https://github.com/D3vd/Meme_Api&lt;/a&gt;. This API returns a &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; response containing information about random memes from Reddit. Hmm, let’s see how it works by visiting this URL: &lt;a href="https://meme-api.herokuapp.com/gimme" rel="noopener noreferrer"&gt;https://meme-api.herokuapp.com/gimme&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is the response that I got:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;postLink&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://redd.it/w0teq0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;subreddit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;me_irl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;me_irl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;url&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://i.redd.it/ztpkxx6yl0c91.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;nsfw&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;spoiler&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;author&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ozgonngu&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ups&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;110&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;preview&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://preview.redd.it/ztpkxx6yl0c91.png?width=108&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026crop=smart&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026auto=webp&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026s=e3db2a1ed5ee73480224b55b16fcb38925ea9095&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://preview.redd.it/ztpkxx6yl0c91.png?width=216&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026crop=smart&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026auto=webp&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026s=aaec73a28c4c0b2bc47f4f9722be2fdb8ba95893&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://preview.redd.it/ztpkxx6yl0c91.png?width=320&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026crop=smart&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026auto=webp&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026s=90495a39d05f6d9d8975fb776887c08f65ece2c4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://preview.redd.it/ztpkxx6yl0c91.png?width=640&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026crop=smart&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026auto=webp&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026s=b291abfb8f85b5826f001dee881570e694bdb46c&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://preview.redd.it/ztpkxx6yl0c91.png?width=960&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026crop=smart&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026auto=webp&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;u0026s=7afc3f2532c7017a0045ae50777a18a2e452183e&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It looks like the &lt;code&gt;url&lt;/code&gt; field here contains the link for the meme's image. How about we have our bot respond to user's messages with this image?&lt;/p&gt;

&lt;h3&gt;
  
  
  Integrating the Meme API
&lt;/h3&gt;

&lt;p&gt;Let's paste these lines of code to the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_meme&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
  &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;https://meme-api.herokuapp.com/gimme&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;json_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json_data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;url&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;requests&lt;/code&gt; package allows us to make HTTP requests to any URL. In this case we're calling the GET method to the URL that will give us the meme data.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;json&lt;/code&gt; package allows us to read JSON data. This is useful since most data passed around on the web is in the JSON format, like the JSON response we saw above.&lt;/p&gt;

&lt;p&gt;We need to install the &lt;code&gt;requests&lt;/code&gt; package to import it. Run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now all we need to do is call &lt;code&gt;get_meme()&lt;/code&gt; inside our bot's &lt;code&gt;on_message()&lt;/code&gt; method. Let's also change the keyword from &lt;code&gt;$hello&lt;/code&gt; to &lt;code&gt;$meme&lt;/code&gt; since it's more fitting. Your code should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;discord&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_meme&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
  &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;https://meme-api.herokuapp.com/gimme&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;json_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json_data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;url&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;discord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Logged on as {0}!&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$meme&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;get_meme&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Your Token Here&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Replace with your own token
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Time to test it out!&lt;/p&gt;

&lt;p&gt;Just remember you need to close and restart your program. Press control+c to close the currently running program in the terminal and then, run &lt;code&gt;python3 bot.py&lt;/code&gt; again.&lt;/p&gt;

&lt;p&gt;The moment of truth...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fcodedex-io%2Fprojects%2Fmain%2Fprojects%2Fbuild-a-discord-bot-with-python%2Ffinal.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fcodedex-io%2Fprojects%2Fmain%2Fprojects%2Fbuild-a-discord-bot-with-python%2Ffinal.gif" alt="Toad Meme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Success! 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;That's all it takes to set up and code a Discord bot in Python! Just a note: the bot will respond to you as long as the program is kept running. If you close your terminal or turn off your computer, it will no longer be running. If you want to keep the program running forever, we’ll have to deploy it to another computer in the cloud. However, that is a lesson for another day.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed the tutorial. If you have any questions, you can DM me on twitter at &lt;a href="https://twitter.com/hongjjeon" rel="noopener noreferrer"&gt;@hongjjeon&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  More Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/codedex-io/projects/blob/main/projects/build-a-discord-bot-with-python/bot.py" rel="noopener noreferrer"&gt;Solution on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://discord.com/developers/docs/intro" rel="noopener noreferrer"&gt;Discord Developer Portal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;About the Author:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hong Jeon is a Software Engineer at Waymo (formerly known as the Google self-driving car project). Hong discovered his passion for sharing knowledge in college during his time as a Teaching Assistant in several programming classes. You can catch him on Twitter at &lt;a href="https://twitter.com/hongjjeon" rel="noopener noreferrer"&gt;@hongjjeon&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>discord</category>
      <category>tutorial</category>
      <category>codedex</category>
    </item>
    <item>
      <title>Visualize YouTube Data with Plotly Express</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Wed, 17 Aug 2022 19:05:00 +0000</pubDate>
      <link>https://dev.to/codedex/visualize-youtube-data-with-plotly-express-27cp</link>
      <guid>https://dev.to/codedex/visualize-youtube-data-with-plotly-express-27cp</guid>
      <description>&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt; Python fundamentals, Microsoft Excel&lt;br&gt;
&lt;strong&gt;Versions:&lt;/strong&gt; Python 3.10, Plotly 5.9&lt;br&gt;
&lt;strong&gt;Read Time:&lt;/strong&gt; 45 minutes&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;So you want to learn about making data visualizations, huh? Well, you’re in the right spot! &lt;/p&gt;

&lt;p&gt;Data visualization is translating data into a visual representation to make it easier on the human eye. It makes communicating complex ideas more effective, quick, and easy to follow. It is super important as it makes data more accessible and digestible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://plotly.com/python/plotly-express"&gt;Plotly Express&lt;/a&gt; makes it easy to begin learning this process. It is an easy-to-use, high-level module that creates common figures such as line graphs and scatter plots. Plotly was actually the first library I used when I started my journey in data!&lt;/p&gt;

&lt;p&gt;In this tutorial, we will create data visualizations of popular YouTube channels using &lt;a href="https://www.python.org"&gt;Python&lt;/a&gt;, &lt;a href="https://plotly.com/python/plotly-express"&gt;Plotly Express&lt;/a&gt;, and &lt;a href="https://research.google.com/colaboratory"&gt;Google Colab&lt;/a&gt;. We will use a histogram to look at subscriber counts, a pie chart to compare video categories, and a box plot to find patterns in the years that creators started YouTubing. &lt;/p&gt;

&lt;p&gt;Let’s get into it (yuh)!&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up
&lt;/h2&gt;

&lt;p&gt;First, visit &lt;a href="https://research.google.com/colaboratory"&gt;colab.research.google.com&lt;/a&gt; and start a "New notebook". &lt;/p&gt;

&lt;p&gt;After that, make sure you have the latest version of Python on your machine. You can check this by typing &lt;code&gt;$ python --version&lt;/code&gt; in the Windows command prompt or the terminal on Mac and Linux. It would be best if you were running Python version 3.10 or above.&lt;/p&gt;

&lt;p&gt;Once you have checked this, pull up the &lt;a href="https://plotly.com/python/plotly-express"&gt;Plotly Express docs page&lt;/a&gt;. It will come in handy while working. Finally, download the dataset used for this tutorial from down below. There would not be a data visualization without some data!&lt;/p&gt;
&lt;h2&gt;
  
  
  About the Dataset
&lt;/h2&gt;

&lt;p&gt;For this tutorial, we will use the "Most Subscribed YouTube Channels" dataset from &lt;a href="https://www.kaggle.com"&gt;Kaggle&lt;/a&gt;. The file is called &lt;strong&gt;most_subscribed_youtube_channels.csv&lt;/strong&gt;. You can &lt;a href="https://www.kaggle.com/datasets/surajjha101/top-youtube-channels-data"&gt;download it here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As the name suggests, it contains data about the top 1000 YouTube channels. &lt;/p&gt;

&lt;p&gt;There are seven columns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rank&lt;/code&gt;: Rank of the channel as per total subscribers (1-1000)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;youtuber&lt;/code&gt;: Channel name&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;subscribers&lt;/code&gt;: Total number of followers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;video views&lt;/code&gt;: Total views of all the videos combined&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;video count&lt;/code&gt;: Number of videos uploaded&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;category&lt;/code&gt;: Channel genre&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;started&lt;/code&gt;: The year that the channel started&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It looks something like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QG3-EEuQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/dataset-screenshot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QG3-EEuQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/dataset-screenshot.png" alt="Dataset" width="880" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have made acquaintance with our dataset. Now, let’s jump into some visualizations!&lt;/p&gt;
&lt;h3&gt;
  
  
  Importing the Data to Google Colab
&lt;/h3&gt;

&lt;p&gt;First things first (I’m the realest), we are going to import our data into our notebook. After downloading your dataset, you should return to your handy dandy Google Colab notebook. &lt;/p&gt;

&lt;p&gt;Inside the notebook, go ahead and input the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;google.colab&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;

&lt;span class="n"&gt;uploaded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upload&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press the play button, and there will be a prompt to upload files from your computer. Look in your local drive for the dataset (&lt;strong&gt;most_subscribed_youtube_channels.csv&lt;/strong&gt;) and upload the file. &lt;/p&gt;

&lt;p&gt;You should have something like this!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8pG40-3q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/import-data.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8pG40-3q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/import-data.png" alt="import data" width="880" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Importing Pandas and Declaring a DataFrame
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://pandas.pydata.org"&gt;Pandas&lt;/a&gt; is the most widely used open source Python package to perform data analytics. To use it, we will &lt;code&gt;import pandas as pd&lt;/code&gt;. &lt;code&gt;pd&lt;/code&gt; serves as the alias (nickname) for referring to the Pandas package in our program. &lt;/p&gt;

&lt;p&gt;After importing Pandas, we will need to &lt;code&gt;import io&lt;/code&gt;. Doing this will let us import our data into a DataFrame and work with file-related input/output operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;io&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have done that, we need to create a Pandas DataFrame. A &lt;a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html"&gt;Pandas DataFrame&lt;/a&gt; stores data as a 2-dimensional table in Python. As analysts, we want to be quick in generating graphs, so we can take our time analyzing and reporting our findings. And DataFrames are a great way to structure our data; they are fast, easy to use, and integral to the Python data science ecosystem. You can use any shorthand name for the DataFrame variable, but for this example, we will use &lt;code&gt;df&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;df&lt;/code&gt; variable will store the DataFrame returned from the &lt;code&gt;pd.read_csv()&lt;/code&gt; method. To do that, you would put in &lt;code&gt;pd.read_csv(io.BytesIO(uploaded[file_name.csv]))&lt;/code&gt;. This line reads our CSV (comma-separated value) file and returns it as a DataFrame.&lt;/p&gt;

&lt;p&gt;And lastly, use the &lt;code&gt;display()&lt;/code&gt; function to show the &lt;code&gt;df&lt;/code&gt; DataFrame.&lt;/p&gt;

&lt;p&gt;You should have the following after completing the steps above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;io&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BytesIO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uploaded&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"most_subscribed_youtube_channels.csv"&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;span class="n"&gt;display&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your notebook should now look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--800CDLft--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/import-pandas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--800CDLft--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/import-pandas.png" alt="import pandas" width="880" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice how in some of the numeric columns, there are commas in between the numbers? Let's take out the commas using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;","&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;display&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we are using the &lt;code&gt;.replace()&lt;/code&gt; method to replace all occurrences of commas &lt;code&gt;","&lt;/code&gt; with nothing &lt;code&gt;""&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For the next section, we will be creating three different graphs: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A histogram to look at subscriber count.&lt;/li&gt;
&lt;li&gt;A pie chart to analyze video categories.&lt;/li&gt;
&lt;li&gt;A box plot to explore the different years people start YouTubing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s kick things off with the histogram!&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 1: Make a Histogram
&lt;/h2&gt;

&lt;p&gt;Normally, people will import their library during setup. However, I like to have my imports and graph code together. Therefore, we are going to import the Plotly Python package by writing &lt;code&gt;import plotly.express as px&lt;/code&gt;. &lt;code&gt;px&lt;/code&gt; will serve as the alias for the package in this portion of the process. After you have imported Plotly Express, we will be ready to start on our histogram!&lt;/p&gt;

&lt;p&gt;The import statement should be as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;plotly.express&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a histogram in Plotly Express is so much easier than you think. Do you know how we create them? Drum roll, please… 🥁&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;fig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;histogram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"subscribers"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Subscriber Count"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alright, let’s break down this line of code.&lt;/p&gt;

&lt;p&gt;First, we need to declare a variable &lt;code&gt;fig&lt;/code&gt;. &lt;code&gt;fig&lt;/code&gt; will allow us to work with the Plotly Express library that is accessible using the &lt;code&gt;px&lt;/code&gt; alias. Remember &lt;code&gt;px&lt;/code&gt; from earlier? We use it to determine the type of graph we want to utilize. For example, we typed out &lt;code&gt;px.histogram()&lt;/code&gt; because we wanted to plot a histogram.&lt;/p&gt;

&lt;p&gt;The arguments passed in the method call are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The DataFrame &lt;code&gt;df&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;x&lt;/code&gt; value that needs to be displayed in the histogram. Since we are looking at subscriber count in this exercise, the &lt;code&gt;x&lt;/code&gt; value will be the name of the column that contains the subscribers data in the DataFrame. &lt;/li&gt;
&lt;li&gt;The name for our graph. We do this through the &lt;code&gt;title&lt;/code&gt; variable. Make sure you put quotation marks around them since they are considered a string. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After we do this, we will use &lt;code&gt;fig.show()&lt;/code&gt;, and the notebook should display something like this!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9t2tVtoV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/histogram.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9t2tVtoV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/histogram.png" alt="histogram" width="880" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is so much going on right now in the histogram, so let’s take it step by step.&lt;/p&gt;

&lt;p&gt;The first thing we want to do is pay attention to our axes. On the x-axis, we have our variable &lt;code&gt;subscribers&lt;/code&gt;. On the y-axis, we have the count of channels with subscribers in that range. In histograms, the bars show us frequency rather than a solid number of things. For our example, we can see a high frequency of YouTubers with between 0 and 40 million subscribers. &lt;/p&gt;

&lt;p&gt;Also, a quick shoutout to the channel all the way at the end that made it to 200 million (&lt;a href="https://www.youtube.com/aashiqui2"&gt;T-Series&lt;/a&gt;). We already know their fan base is grinding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 2: Make a Pie Chart
&lt;/h2&gt;

&lt;p&gt;We are going to do the same thing we did before, but this time we will create a pie chart. For this pie chart, we are going to analyze the different video categories and the top channel they belong to. &lt;/p&gt;

&lt;p&gt;All we need to do is replace &lt;code&gt;px.histogram(df, x="subscribers")&lt;/code&gt; with &lt;code&gt;px.pie(df, values="subscribers" names="category", title="YouTube Categories")&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;plotly.express&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;

&lt;span class="n"&gt;fig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"subscribers"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"category"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"YouTube Categories"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, this time we need to pass the following arguments to our method call: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;values&lt;/code&gt; from our data that will represent a portion of the pie chart.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;names&lt;/code&gt; that will represent the names for those regions of the pie chart. For this part, you would need to use a column with numeric values for the &lt;code&gt;values&lt;/code&gt; argument and a column with string values for the &lt;code&gt;names&lt;/code&gt; variable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;title&lt;/code&gt; to name the graph. You can choose whatever name you want here, but for the sake of this example, we will call our graph “YouTube Categories”. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s it. All that’s left now is to display the pie chart using the &lt;code&gt;fig.show()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;You should end up with something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---U74sdWG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/pie-chart.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---U74sdWG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/pie-chart.png" alt="pie-chart" width="880" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pie charts are very straightforward to read. The bigger the chunk, the greater quantity we have. We can see here that the top category in our dataset is Music (24.9%). Coming in at number two is Entertainment (22.1%).&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 3: Make a Box Plot
&lt;/h2&gt;

&lt;p&gt;I hope you all aren’t too square to make a box plot. Box plots can show us how spread out our data is. For this example, we are going to use a box plot to analyze the different years people start YouTube.&lt;/p&gt;

&lt;p&gt;Sticking to the theme of simplicity, all we have to do to create our box plot is input the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;plotly.express&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;

&lt;span class="n"&gt;fig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"started"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Years Started"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;px.box()&lt;/code&gt; method follows the convention we have been using in this tutorial:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, we passed in our DataFrame, &lt;code&gt;df&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;Then, we passed in our &lt;code&gt;y&lt;/code&gt; variable, &lt;code&gt;started&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;Finishing things off, we named our graph “Years Started”. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And like before, the graph is complete but isn’t shown on the notebook page. So, to show the graph, we use &lt;code&gt;fig.show()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;It should look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mGe1iWJT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/box-plot.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mGe1iWJT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/codedex-io/projects/main/projects/visualize-youtube-data-with-plotly/box-plot.jpg" alt="box-plot" width="880" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like that one Tegan and Sara song, let’s get a little bit closer with our graph. In a box plot, we have our minimum value, lower fence, Q1, median, Q3, and maximum value. For this tutorial, we will only be looking at our lower fence, median, and maximum. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the lower fence, we have the year 2005. This conveys that the earliest top channels got started in 2005. Talk about being there from the very start! &lt;/li&gt;
&lt;li&gt;The median, 2013, represents the average year our top channels started their career. Ah, 2013. What a time to be alive.&lt;/li&gt;
&lt;li&gt;Our maximum value was 2021. This was the latest year a top channel in our dataset started. As they always say, it's never too late to begin your journey to the top!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Congrats, you just created three data visualizations analyzing the top dogs on YouTube! &lt;/p&gt;

&lt;p&gt;Many people assume data visualization is such a complex thing, but it can be as easy as running a few lines of code. One piece of advice I would give you is to practice using one type of library for your first few months of learning data visualizations. It will give you the opportunity to get the hang of things and learn about your preferences.&lt;/p&gt;

&lt;h3&gt;
  
  
  More Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://colab.research.google.com/drive/10X7qNLzXYhr2rIUaG1rkC5NHKB31TYXf"&gt;Solution on Google Colab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.kaggle.com/datasets/surajjha101/top-youtube-channels-data"&gt;Dataset on Kaggle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/codedex-io/projects/blob/main/projects/visualize-youtube-data-with-plotly/most_subscribed_youtube_channels.csv"&gt;Dataset on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;About the Author:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Miracle Awonuga is a senior at Belmont University studying Data Science and Video Production. Lately, she has been working on WaffleHacks, a student-led hackathon as the Co-Director of People and Communications. 🧇&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>python</category>
      <category>tutorial</category>
      <category>codedex</category>
    </item>
    <item>
      <title>Can You Guess the Word? (Python Edition)</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Wed, 03 Aug 2022 17:33:00 +0000</pubDate>
      <link>https://dev.to/codedex/can-you-guess-the-word-python-edition-4p3n</link>
      <guid>https://dev.to/codedex/can-you-guess-the-word-python-edition-4p3n</guid>
      <description>&lt;p&gt;Happy Wednesday! Here are three Rebus Puzzles for all the Pythonistas out there! 🐍&lt;/p&gt;

&lt;p&gt;Can you guess the message in each of the three images?&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
    &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__two-pics"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Saw-Ph5A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/media/FZQFyxcWQAIHS73.jpg" alt="unknown tweet media content"&gt;
    &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--dH3PEO97--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1523772807544512513/C-ckSsu3_normal.jpg" alt="Codédex profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Codédex
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @codedex_io
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Can you guess the message in each of the images? Hint: It’s all Python related! 🐍&lt;br&gt;&lt;br&gt;And don’t share the answers! 🤫&lt;br&gt;&lt;br&gt;&lt;a href="https://twitter.com/hashtag/Python"&gt;#Python&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/Python"&gt;#Python&lt;/a&gt;3 &lt;a href="https://twitter.com/hashtag/Python"&gt;#Python&lt;/a&gt;Programming &lt;a href="https://twitter.com/hashtag/Python"&gt;#Python&lt;/a&gt;Learning &lt;a href="https://twitter.com/hashtag/CodeNewbie"&gt;#CodeNewbie&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/100DaysOfCode"&gt;#100DaysOfCode&lt;/a&gt;  &lt;a href="https://twitter.com/hashtag/Programming"&gt;#Programming&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/Coding"&gt;#Coding&lt;/a&gt; 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      17:00 PM - 03 Aug 2022
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1554874945947279361" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1554874945947279361" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1554874945947279361" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;Tag a Python friend, but don’t share the answers! 🧠&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>discuss</category>
      <category>codedex</category>
    </item>
    <item>
      <title>8-Bit Learn to Code Platform!</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Thu, 28 Jul 2022 16:05:00 +0000</pubDate>
      <link>https://dev.to/codedex/8-bit-learn-to-code-platform-20cl</link>
      <guid>https://dev.to/codedex/8-bit-learn-to-code-platform-20cl</guid>
      <description>&lt;p&gt;👋 Hello Devs! &lt;/p&gt;

&lt;p&gt;I’m Sonny, Founder and Chief Vibes Officer of &lt;a href="https://www.codedex.io" rel="noopener noreferrer"&gt;Codédex&lt;/a&gt;, a brand new learn to code platform for high schoolers and college students. &lt;/p&gt;

&lt;p&gt;We are beyond excited to announce that we just launched! 🥳🚀🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codedex.io" rel="noopener noreferrer"&gt;https://www.codedex.io&lt;/a&gt; ✨&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1552680081838989316-779" src="https://platform.twitter.com/embed/Tweet.html?id=1552680081838989316"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1552680081838989316-779');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1552680081838989316&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;After working at the intersection of education and technology for the past seven years, I found that project-based learning and gamification are the most effective ways to keep young students engaged in their coding journey.&lt;/p&gt;

&lt;p&gt;Mix that in with a touch of 8-bit aesthetics, and we aim to create nothing short of a magical experience. 👾&lt;/p&gt;

&lt;p&gt;This v1.0 launch includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📱 Mobile view&lt;/li&gt;
&lt;li&gt;🔓 Challenge unlock&lt;/li&gt;
&lt;li&gt;🏃‍♂️ User progress&lt;/li&gt;
&lt;li&gt;⏳ User streak&lt;/li&gt;
&lt;li&gt;📛 Badges&lt;/li&gt;
&lt;li&gt;🛠 Project tutorials&lt;/li&gt;
&lt;li&gt;🏗 React &amp;amp; Next.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please check out &lt;a href="https://www.codedex.io" rel="noopener noreferrer"&gt;Codédex&lt;/a&gt; and let me know what you think! 🙏&lt;/p&gt;

&lt;p&gt;P.S. Here’s the team saying hi:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jclfblid28ucmpw0mn4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jclfblid28ucmpw0mn4.gif" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>news</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Learn LOLCODE</title>
      <dc:creator>Sonny Li</dc:creator>
      <pubDate>Tue, 02 Apr 2019 02:28:00 +0000</pubDate>
      <link>https://dev.to/sonnynomnom/learn-lolcode-45fc</link>
      <guid>https://dev.to/sonnynomnom/learn-lolcode-45fc</guid>
      <description>&lt;p&gt;Happy April Fool's! To celebrate, my coworker &lt;a href="https://dev.to/joshuakgoldberg"&gt;@joshuakgoldberg&lt;/a&gt; wrote a brief LOLCODE course on Codecademy. And yes, it's real. However, it's an easter egg course, meaning, it doesn't live in the catalog. You can only access it with the secret link:&lt;/p&gt;

&lt;p&gt;✨ &lt;a href="https://codecademy.com/learn/learn-lolcode" rel="noopener noreferrer"&gt;Learn LOLCODE&lt;/a&gt; ✨&lt;/p&gt;

&lt;p&gt;Inspired by the old lolcat memes, LOLCODE is an esoteric programming language with catchphrases like &lt;code&gt;I CAN HAS&lt;/code&gt; and &lt;code&gt;KTHXBYE&lt;/code&gt; in place of traditional keywords.&lt;/p&gt;

&lt;p&gt;P.S. The course also features some of our team members' cat babies! 😻&lt;/p&gt;

</description>
      <category>lolcode</category>
      <category>beginners</category>
      <category>news</category>
      <category>codecademy</category>
    </item>
  </channel>
</rss>
