Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

for if loop confusion

how to comand like lets say A= int(input(...)) #to get a number for A == #any number given how can i say like for every number given for A do some calculation like A+1

1 Answer

Hey Ihsan

Take a look at while loops, they keep repeating a code of block, while some condition is true, so it might be usefull here for you. Also, you can try formating the for loop for something like this:

for num in list:
    user_input = input("")
    user_input + 1

Let me know how it goes...

make sense a lot thanx