Videos
So taking up suggestions from my "gibberish" post yesterday (thanks to all who replied, not sure why mods removed it), I decided to continue my days-old project of learning Python by actually sitting down to write my first code. Why not? Let's give it a try.
After learning about the # symbol and how it provides "commentary" for the lines of code, I decided to write down my proposed code within the # lines. I asked myself, what do I want the result to be? Here, I decided a friend says either they like my red shirt or doesn't say anything about the shirt if it is a color other than red. And then I asked myself, what are the steps to get there? Here, I said there has to be an action for what the friend will say (the print command determined by a "red or else" function) and also a variable that is fill-in-the-blank for either red or not red (the variable).
This took me several tries and I did encounter a few errors. These were syntax errors relating to the correct variable and function terminology. But otherwise about 10 minutes from beginning to successful end. I'm pretty proud of this. Hopefully this post helps another Python newbie out there.
# This code will have a friend say either one of two things in response to seeing me, depending upon the color of my shirt.
#
# If my shirt is red, my friend will say hello and say he likes my shirt.
#
# But if my shirt is not red, my friend will just say hello.
#
# My code needs these items: A fill-in-the-blank for the color of my shirt, red or otherwise.
# My code also needs some kind of function which determines what my friend will say depending upon the color of my shirt.
my_shirt_color_today = ["red"]
if my_shirt_color_today == ["red"]:
print("Hello friend, I like the color of your shirt! Red is my favorite")
else:
print("Hello friend! Why didn't you wear your red shirt today?")I am struggling to find a reason to continue learning Python, as I am not looking to code for a career. Are there any practical uses for learning Python for everyday use? Yes I know about the book/website for 'Automate the Boring Stuff', but even that is not all that practical for me. One project I did find very practical was using Python to code a command line terminal based interface to chatGPT to avoid their web-based site (this came in handy yesterday when their website was overloaded, too busy, and I could not do a chatGPT session--- but I ran my console version using Python and was able to connect and do a session with chatGPT (that did not use the overloaded web port). So I am wondering about practical uses like that.