Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List iteration
#2
(Nov-11-2020, 08:08 AM)Peca Wrote: I do not know how to make for loop and put on square.
does annybody can give me instruction ,to learn something

Fire up your Python interactive interpreter and type help('for'), this way you learn how for-loop is operating. Next step could be entering help(str.split) to understand how this method is working and what arguments can be passed (to exit help press Q).

But before you start all this you should articulate the 'algorithm' how to achieve objective. I personally would do something like this:

- how to split string into digits
- how to convert digits in str datatype into integers
- how to square integers
- how to construct string from squared integers
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
List iteration - by Peca - Nov-11-2020, 08:08 AM
RE: List iteration - by perfringo - Nov-11-2020, 08:46 AM
RE: List iteration - by deanhystad - Nov-11-2020, 05:13 PM

Forum Jump:

User Panel Messages

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