Skip to main content
Image

r/learnpython


Are you a Python programming beginner?
Are you a Python programming beginner?

Are you a beginner learning Python?

As a beginner I’m interested in starting a small group of 4–10 people who are interested in Python, where we can connect, help each other, share what we learn, and grow together.

People who already have some experience with Python are also welcome to join — especially if you’re interested in helping others and learning together.

If you’re interested, leave a comment below!


Advertisement: Prime Big Deal Days is coming October 6-7. Shop big deals on beauty, electronics, and more.
Prime Big Deal Days is coming October 6-7. Shop big deals on beauty, electronics, and more.
media poster



While loop
While loop

Hello everyone just learning python and need to create a while loop that shows interest and years I’m struggling with operands please help.

Here’s what I have so far:

Interest_rate = int(input(“rate in whole number”)
Initial_investment = float(input(“whole number”)
Interest = interest_rate / 100
Years = 0
investment = initial_investment + {initial_investment * interest}
While investment < (initial_investment * 2):
Print(f’Year: {years} Investment: {investment})
years +=1
Investment = (investment + {investment * interest})

I know that line 5 is two different operands but where did I go wrong and how can I fix?? Please and thank you!