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)

With a single source of truth for all ongoing projects across your entire org, you get a crystal-clear view of what's happening (or not), and who's responsible.

Ditch the needless meetings and repetitive updates. Try ClickUp for free today.

Image With a single source of truth for all ongoing projects across your entire org, you get a crystal-clear view of what's happening (or not), and who's responsible.


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


iOS apps to refresh Python syntax? iOS apps to refresh Python syntax?

Hi!

I’m a stay-at-home mom with a CS degree and finance background (mostly reporting). Right now I plan to get back to my career.

I used to code in Java during my university years, so I’m familiar with OOP and programming in general. Right now, I just want to refresh Python syntax, understand Python approaches, and do some small hands-on exercises

Since I have a very energetic small child at home, I can’t use a laptop regularly. That’s why I’m specifically looking for iOS apps. I think this would be enough for revisiting the basics, with a plan to switch back to a laptop later once son is used to his nursery.

I’ve tried some apps already, but some feel poorly structured (e.g., practical questions before any explanation), while others are heavily paywalled.

Any recommendations?

I’d also appreciate any general advice, as I’m planning to move back into data analytics later on.

Thanks