Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with this code
#2
Please use code or python tags when posting code, see the BBCode link in my signature, below.

A for loop in Python is very simple:

for i in range(256):
    print(i)
The chr function will convert an int to str. Depending on the restrictions on your homework assignment you might want to look at the itertools module, or consider doing this with recursion (so you don't have to write out all of the loops).
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Help with this code - by skriff - Aug-21-2017, 12:51 PM
RE: Help with this code - by ichabod801 - Aug-21-2017, 01:00 PM
RE: Help with this code - by skriff - Aug-21-2017, 01:24 PM
RE: Help with this code - by wavic - Aug-21-2017, 02:01 PM
RE: Help with this code - by ichabod801 - Aug-21-2017, 02:19 PM
RE: Help with this code - by Larz60+ - Aug-21-2017, 02:31 PM
RE: Help with this code - by skriff - Aug-21-2017, 04:12 PM
RE: Help with this code - by wavic - Aug-21-2017, 09:34 PM

Forum Jump:

User Panel Messages

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