Python Forum
What's the meaning of this coding?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What's the meaning of this coding?
#1
What's the meaning of this code? Could someone please explain this to me? Thanks! Huh

temp = input('Please enter a number:')
number = int(temp)
i = 1
while number:
    print(i)
    i = i + 1
    number = number - 1
I could write the first two lines but the later on of i = i +1 & number = number -1
What's the relationship between the number and i?
Reply


Messages In This Thread
What's the meaning of this coding? - by xin2408 - Feb-01-2018, 06:03 PM
RE: What's the meaning of this coding? - by Larz60+ - Feb-01-2018, 06:16 PM
RE: What's the meaning of this coding? - by xin2408 - Feb-01-2018, 06:41 PM
RE: What's the meaning of this coding? - by buran - Feb-01-2018, 06:58 PM
RE: What's the meaning of this coding? - by Kebap - Feb-02-2018, 01:07 PM
RE: What's the meaning of this coding? - by xin2408 - Feb-02-2018, 08:19 PM
RE: What's the meaning of this coding? - by Kebap - Feb-08-2018, 10:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Syntax meaning SUHIN 1 2,054 Sep-22-2018, 08:08 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020