Viewing a response to: @profitgenerator/learn-basic-python-programming-ep-3-logic-and-loops
Sweet! The way I like to think about the for loop in python is that it's actually the foreach from other languages. Since you can achieve with the while loop anything you could with the classical for loop why not shorten the foreach and call it a day!
author | ragequit |
---|---|
permlink | re-profitgenerator-learn-basic-python-programming-ep-3-logic-and-loops-20170630t131358289z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2017-06-30 13:14:00 |
last_update | 2017-06-30 13:14:00 |
depth | 1 |
children | 2 |
last_payout | 2017-07-07 13:14:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.174 HBD |
curator_payout_value | 0.003 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 252 |
author_reputation | 84,968,448,410 |
root_title | "Learn Basic Python Programming EP.3. - Logic & Loops" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 6,759,315 |
net_rshares | 20,415,984,018 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
profitgenerator | 0 | 20,415,984,018 | 100% |
I didnt quite understood what is the difference between foreach and for, I believe it can iterate other things too not just numbers. Also keep in mind that I have like medium knowledge about python, I have not much experience with using classes and other objects , I have to learn more about those. But I will touch functions and other basic things in this tutorial.
author | profitgenerator |
---|---|
permlink | re-ragequit-re-profitgenerator-learn-basic-python-programming-ep-3-logic-and-loops-20170630t131616200z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2017-06-30 13:16:36 |
last_update | 2017-06-30 13:16:36 |
depth | 2 |
children | 1 |
last_payout | 2017-07-07 13:16:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 367 |
author_reputation | 68,549,319,463,075 |
root_title | "Learn Basic Python Programming EP.3. - Logic & Loops" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 6,759,576 |
net_rshares | 0 |
Explaining to others is a great way of making sure you understand something, it's a good thing to do once you feel like you master something. It also helps you figure out what you don't understand that well and look over it again. The idea is that Python doesn't have a foreach syntax like other languages, instead the for loop works like a foreach would. If you have no idea what I'm talking about don't stress it, it's just a tip for whoever is coming from another language that has the classic for loop >for (element = 0; element < list; element++) to remember that python's <strong>for</strong> is actually a foreach >for~~each~~ element in list: ___do stuff
author | ragequit |
---|---|
permlink | re-profitgenerator-re-ragequit-re-profitgenerator-learn-basic-python-programming-ep-3-logic-and-loops-20170630t133146213z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2017-06-30 13:31:48 |
last_update | 2017-06-30 13:31:48 |
depth | 3 |
children | 0 |
last_payout | 2017-07-07 13:31:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 666 |
author_reputation | 84,968,448,410 |
root_title | "Learn Basic Python Programming EP.3. - Logic & Loops" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 6,761,226 |
net_rshares | 0 |