Skip to main content
r/learnpython icon

r/learnpython

members
online

First project without any help from chatGPT First project without any help from chatGPT
This is one of the simplier projects that I have completed, so not as much need to keep asking chatGPT questions. Although, the study function on chatGPT can be helpful at times, I began to rely to heavily on it. 




# Calculator


# Two numbers input from the console


number_one = int(input("Please enter a number: "))
number_two = int(input("Please enter a number: "))


add = "+"
subtract = "-"
multiply = "*"
division = "/"


selectoperand = input(f"Please choose an operator {add, subtract, multiply, division} ")



# function to add two numbers together
def Add(number_one, number_two):
    total = number_one + number_two
    # Does calculation
    return total 


Add(number_one, number_two)


#Added numbers stored in a variable


result = Add(number_one, number_two)
#Prints result


#-------------------------------------------------------


def Subtract(number_one, number_two):
        total = number_one - number_two
        return total


Subtract(number_one, number_two)


resultforsubtraction = Subtract(number_one, number_two)


#-------------------------------------------------------



def Multiply(number_one, number_two):
      total = number_one * number_two
      return total


    
Multiply(number_one, number_two)


resultformultiplication = Multiply(number_one, number_two)



def Division(number_one, number_two):
      total = number_one / number_two
      return total


Division(number_one, number_two)


resultfordivision = Division(number_one, number_two)




if selectoperand == "+":
    print(result)
elif selectoperand == "-":
    print(resultforsubtraction)
elif selectoperand == "*":
    print(resultformultiplication)
elif selectoperand == "/":
    print(resultfordivision)

YSK: Codecademy makes coding jobs attainable. Start learning.
Image YSK: Codecademy makes coding jobs attainable. Start learning.


I learned interactive python and it is so amazing I learned interactive python and it is so amazing

so any beginners like super beginners use this. it is so fun i was just so burned out (i am a beginner ).i just learned upto dictionaries and tuples . then i learned about pip , venv etc and i again find learning python so fun.thanks for everyone who suggested me this.

EDIT: By interactive python I mean learning python in a more hands-on way instead of just writing .py files and running them once.

What I used:

VS Code + Python extension
https://marketplace.visualstudio.com/items?itemName=ms-python.python

Jupyter support in VS Code (this helped A LOT)
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter

Virtual environments (venv)
https://docs.python.org/3/library/venv.html

pip (package manager)
https://pip.pypa.io/en/stable/

Using Jupyter / interactive cells lets you run code line by line, see output instantly, test things quickly, and not get burned out.
After learning basics like lists, dicts, tuples, this made python feel fun again for me.

I’m still a beginner, but this really helped

EDIT: many of you guys are asking me about which video so https://youtu.be/ygXn5nV5qFc?si=-qDjy4_-YIpORX0g i was just watching this video and at the start while setting my vscoe i got to know these things