Learning python - Little Me
A New Language
After learning html approximately 3 years ago, I was eager to learn a new programming language. Ever since I learnt html I always thought at the back of my mind, I should learn a language that interacts with me and not one that is only used to display webpages. That is why I decided to learn python. Whilst I rummaged through some information in the book that came with the raspberry pi 400 kit, I started to feel a urge to create my own programming language. A simple language but one that is capable of many detailed commands. My dad said there was a language with mostly white blanks. I did not believe him and that language was not listed in Wikipedia list of all programming languages. My dad said it was surprising that it was not in Wikipedia but I was not convinced. Finally he looked it up on google and apparently it is actually true. The whitespace language, a language that consists of blanks and hardly any text. I knew with all the languages, my language had to be unique. I decided that it was important for me to learn at least the basics of python before I come up with my own language.
Learning the language
At last it was time for me to learn this language. I started of trying to find some type of python learning source and I completely forgot that the raspberry pi 400 kit had Thonny python already installed with an useful manual. I got going with a simple hello world code and progressed to loops and then to an user interactive input. One little project I made was a inquiry to find a person named Eureka, a random name I got from the internet. The idea is that the computer is a ghost searching for Eureka. It asks a series of questions as to find Eureka. The program ends when it has successfully found where Eureka is or the person running the program does not know where Eureka is. This program included mostly of the "input" command the "if command" the "elif" command and the "else" command.
print ("hiiiii i am standing next to you now")
print ("tell me your name now or elsssssssse")
username = input ("NOW!")
if username == "sEureka":
print("finally i have found you")
print("mwahahaa")
else:
print("your not interesting")
seenher = input ("btw have you seen a woman named Eureka?")
if seenher == "yes":
print ("i guess i will give you a second chance")
print ("tell me...")
where = input ("do you know where she is right Now")
if where == "yes":
print ("cool beans")
answer1 = input ("where")
if answer1 == "blah blah blah":
print ("huh? ummm... ok i guess um bye eh byeeee!")
else:
print ("oh, great thanks a lot u will be blessed thankyou bye :)")
if where == "no":
print("think carefully do yoou now where she is right now")
secondchance = input ("remember think carefully")
if secondchance == "yes":
oolala = input ("where")
if oolala == "blah blah blah":
print ("huh? ummm... ok i guess um bye eh byeeee!")
else:
print ("oh, great thanks a lot u will be blessed thankyou bye :)")
if secondchance =="no":
print ("oh, ohwell thanks for umm cooperating i guess")
print ("um.. bye?")
print ("yea bye.")
elif seenher == "no":
print ("go away you useless human being")
elif seenher == "i dont know":
print("i mean right at this moment do you know where she will be")
print("think care fully do you know or not")
yesno = input ("yes or no ITS SIMPLE")
if yesno == ("yes"):
print ("ok,... you might do smething benoficial for once")
answer2 = input ("where is she then, at this moment")
if answer2 == "blah blah blah":
print ("huh? ummm... ok i guess um bye eh byeeee!")
else:
print ("oh, great thanks a lot u will be blessed thankyou bye :)")
elif yesno == "no":
print ("ughhhhh get out of here befor i lose my patience")
else:
print ("YOU CANT EVEN ANSWER A QUESTION PROPERPLY")
print ("YOU ARE SOOOO STUPID")
print ("GET OUT YOU,YOU.. WHATEVER")
print ("I SAID OUT!!")
I found that programming in python needs lots of precision. Even one misplaced space could end up making the program malfunction. In python indentation is critical unlike in HTML. Also, unlike HTML, when you run a python program, you can see it in the Shell. Thonny python also allows you to run one line at a time using the Debug and Step Over buttons.
(this blog will get updated as I learn more and more about python)