top of page

My programming journey

Writer's picture: DavidDavid


Hello all, I know it's been awhile since I posted, because I have been learning programming, that combined with school gives me about as free time as you could think. But I've finally had time to sit down and write blogs, so let's get started.


I will split this blog into 5 segments:


  1. My motivations for learning programming

  2. When I got started

  3. What programming language I'm learning

  4. What software I'm using to write my code and resources I'm using to learn

  5. Mini projects I've made so far


My motivation to start learning was, well, pure interest in programming. I've done a little bit of programming in school but I never really got into it, but when I started learning web development (HTML, CSS), an interest in programming grew in me.


And I realised that I could make a career in IT if I learned programming, that combined with eager enthusiasm and adrenaline, I got started. It all began about a week ago, (last Friday), when I decided that I would be learning programming.


The first thing I needed to do was to choose a language to learn, and I chose Python. Why you may ask? I'll list the reasons below:


  • Python is a high-level programming language


What is a high-level programming language?


It means that the code of the language is very similar to human languages, like English, making it easier to understand.


  • General purpose language


What is General purpose language?


It can be used for a wide variety of programs like web development, making applications, software development, game development, data science etc.


  • It's beginner friendly


Coming from a no-coding background, it's nice to learn a language that is easy, but powerful at the same time.


  • It's very popular and in high demand


Lastly, python is one of the most popular languages in the world, according to an article, it is the main coding language for 80% of developers. Which is incredibly high, and tech companies generally look for python experience for a job as a programmer and software engineer.


To write my code, I'm using Visual Studio Code, there are other python Integrated Development Environment (IDE)'s such as Pycharm but I like VSC because I've been using it for web development, and I feel more comfortable using it.


I'm also using Replit on my phone so that I can code no matter where I am or If I don't have access to my PC.


I've been using YouTube as my primary source of learning, along with W3Schools, and on mobile the app Mimo. I think these three work pretty well as I've learned a lot since I began.


The first thing I made was the iconic "Hello World" statement using the print function, if you're a programmer, you've probably began your journey with Hello World as well. But the actual first thing I made was a coffee shop barista, with substantial help from YouTube. I'll post the code snippet below so you can run the code for yourself, but in short, it can take orders from customers and act as a "bouncer" in a coffee shop, like it can stop people with certain names, and ask them something, if they answer correctly, let them in, if not, kick them out, I like it a lot, simple, but cool and pretty good for a first program.



print("Welcome to Eternal Skies, the best coffee shop in New York")

name = input("What is your name\n")

if name == "Alex":
    evil_status = input("Are you evil?\n")
    if evil_status == "Yes":
     print("You are not allowed here")
     exit()
    else:
        print("Oh, so you're one of the those rare Alexs I see, come on in!")

print("Hello " + name +" thank you for coming in today!")

menu = "Chai, Black Coffee, Esspresso, Mocha, Freshly roasted latte, Pumpkin Spiced Latte, Normal coffee, Hot chocolate"

print(name +", " "Here is our menu, have look at what you'd like to try:\n" + menu )

order = input()

if order == "Chai":
    price = 13

elif order == "Black Coffee":
    sugar = input("Would you like sugar with your drink?\n")
    if sugar == "Yes":
        price = 10
    else:
        price = 4
    
elif order == "Mocha":
    whipped_cream = input("Would you like whipped cream?\n")
    if whipped_cream == "Yes":
        price = 25
    else:
        price = 15

elif order == "Freshly roasted latte":
    price = 6
elif order == "Pumpkin Spiced Latte":
    price = 20
elif order == "Esspresso":
    price = 3
elif order == "Normal coffee":
    with_sugar = input("Would you like sugar with your coffee?\n")
    if with_sugar == "Yes":
        price = 10
    else:
        price = 5
elif order == "Hot chocolate":
    white_chocolate = input("Would you like it to be white chocolate?\n")
    if white_chocolate == "Yes":
        price = 18
    else:
        price = 13
else:
    print("Sorry, we don't have that here")
    price = 0

quantity = input("How many would you like?\n")

total = price * int(quantity)

print("Thank you, your total is: $" + str(total))


print("Sounds good " + name +" we will have your " + quantity + " items ready in a moment.")
print("Thank you for choosing Eternal Skies, please come next time.")




And I've been making a calculator, It can do basic arithmetic operations such as Addition, Subtraction, Multiplication and Division.



 def add(num1, num2):
    return num1 + num2

def subtract(num1, num2):
    return num1 - num2

def multiply(num1, num2):
    return num1 * num2

def divide(num1, num2):
    return num1 / num2

print("Please select an operation -\n " \
    "1. Add\n" \
        "2. Subtarct\n" \
            "3. Multiply\n" \
                "4. Division\n")

select = int(input("Select operation form 1, 2, 3, 4 :"))

number_1 = int(input("Enter first number: "))
number_2 = int(input("Enter second number: "))

if select == 1:
    print(number_1, "+", number_2, "=",
     add(number_1, number_2))

elif select == 2:
    print(number_1, "-", number_2, "=",
    subtract(number_1, number_2))

elif select == 3:
    print(number_1, "*", number_2, "=",
    multiply(number_1, number_2))

elif select == 4:
    print(number_1, "/", number_2, "=",
    divide(number_1, number_2))

else:
    print("Invalid input")





     


Note: To run these programs, use any code editor or IDE you prefer, VSC/Replit recommended.


Anyway, I think that should be it for today, I'll post more on this journey and I hope you will enjoy it, for now, Bye.







15 views0 comments

Recent Posts

See All

Comments


bottom of page