Sandra's Weeknotes logo

Sandra's Weeknotes

Archives
Subscribe
Aug. 9, 2023, 5:53 p.m.

Coding lab

Sandra's Weeknotes Sandra's Weeknotes

This is where you will find some of my coding experiments.


Creating an earlier version of an RSS feed reader in Python

Challenge: Parse a feed from a publication I’m familiar with

"""Module providing a function to parse a feed"""
import feedparser

"""This will parse the RSS feed"""
feed = feedparser.parse("https://www.positive.news/rss")

def parse_feed():
"""Function to parse the feed"""
# This will extract and display information

    for entry in feed.entries:
        print("Post title:", entry.title)
        print("Author:", entry.author)
        print("Date:", entry.published)
        print("Summary:", entry.summary)
        print("Link:", entry.link)

if __name__ == "__main__":
    parse_feed()


Familiarising myself with C-sharp

Challenge: Write code in the .NET Editor to display two messages

Select all of the code in the .NET Editor, and press Delete or Backspace to delete it.

Write code that produces the following output:

Output:

This is the first line.

This is the second line.

Source: https://learn.microsoft.com/en-us/training/modules/csharp-write-first/4-challenge

My solution:

Console.WriteLine("This is the first line.");
Console.WriteLine("This is the second line.");

The terminal output:

This is the first line.
This is the second line.

You just read issue #1 of Sandra's Weeknotes. You can also browse the full archives of this newsletter.

Share this email:
Share on LinkedIn Share via email
Powered by Buttondown, the easiest way to start and grow your newsletter.