Python Forum
Newbie have thoughts about logic
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie have thoughts about logic
#12
(Sep-13-2021, 02:05 AM)SamHobbs Wrote:
(Sep-01-2021, 10:33 PM)Yoriz Wrote: if you use more descriptive variable names it reads a bit more like English
for letter in "banana":  print(letter)
Yes the sentence for each letter in "banana" print the letter sounds valid to me.

(Sep-12-2021, 06:01 PM)sdd Wrote: Why use the word "print" when you mean "Check if"? Print means something else in English.
(This is a variation of what Yoriz said.) In the sample you provided, it is printing an expression and the expression is doing a check. The word print is misleading but I definitely do not considering it to be doing Check if; the checking is done by the expression, not the print function.

(Sep-12-2021, 06:11 PM)sdd Wrote: why not simply use the for each expression in python instead of the for-loop expression?
Many other languages often use inappropriate terms. Python is improved over the C language that would say:

char banana[] = "banana";
int x;
for (x = 0; x < strlen(banana); ++x)
printf("%c\n", banana[x]);

If you want a language that is defined to be understandable to non-developers then look at COBOL; COBOL loops are described in COBOL - Loop Statements.
Interesting! Wow - how can anything be done in such a complicated language as C? If I would try and learn that I would go nuts for sure. Thanks for the COBOL tip, I'll look into it.
Reply


Messages In This Thread
Newbie have thoughts about logic - by sdd - Sep-01-2021, 10:20 PM
RE: Newbie have thoughts about logic - by Yoriz - Sep-01-2021, 10:33 PM
RE: Newbie have thoughts about logic - by perfringo - Sep-02-2021, 04:15 AM
RE: Newbie have thoughts about logic - by sdd - Sep-12-2021, 06:11 PM
RE: Newbie have thoughts about logic - by perfringo - Sep-13-2021, 06:15 AM
RE: Newbie have thoughts about logic - by sdd - Sep-13-2021, 08:09 PM
RE: Newbie have thoughts about logic - by Lou - Sep-02-2021, 04:16 AM
RE: Newbie have thoughts about logic - by sdd - Sep-12-2021, 06:01 PM
RE: Newbie have thoughts about logic - by Yoriz - Sep-12-2021, 06:14 PM
RE: Newbie have thoughts about logic - by SamHobbs - Sep-13-2021, 02:05 AM
RE: Newbie have thoughts about logic - by sdd - Sep-13-2021, 07:41 PM
RE: Newbie have thoughts about logic - by SamHobbs - Sep-13-2021, 09:00 PM
RE: Newbie have thoughts about logic - by SamHobbs - Sep-14-2021, 02:32 AM
RE: Newbie have thoughts about logic - by Larz60+ - Sep-14-2021, 02:51 AM
RE: Newbie have thoughts about logic - by sdd - Sep-15-2021, 01:07 AM
RE: Newbie have thoughts about logic - by bowlofred - Sep-15-2021, 03:11 AM
RE: Newbie have thoughts about logic - by SamHobbs - Sep-15-2021, 06:42 PM
RE: Newbie have thoughts about logic - by perfringo - Sep-15-2021, 03:35 AM
RE: Newbie have thoughts about logic - by sdd - Sep-15-2021, 11:11 AM
RE: Newbie have thoughts about logic - by perfringo - Sep-16-2021, 07:07 AM
RE: Newbie have thoughts about logic - by SamHobbs - Sep-15-2021, 01:27 AM
RE: Newbie have thoughts about logic - by Larz60+ - Sep-15-2021, 09:08 AM
RE: Newbie have thoughts about logic - by sdd - Sep-15-2021, 11:37 AM
RE: Newbie have thoughts about logic - by snippsat - Sep-15-2021, 12:29 PM
RE: Newbie have thoughts about logic - by SamHobbs - Sep-15-2021, 06:50 PM
RE: Newbie have thoughts about logic - by ndc85430 - Sep-16-2021, 06:09 PM
RE: Newbie have thoughts about logic - by SamHobbs - Sep-16-2021, 07:36 PM
RE: Newbie have thoughts about logic - by Serafim - Sep-17-2021, 10:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Thoughts on interfacing with a QR code reader that outputs keystrokes? wrybread 1 1,489 Oct-08-2021, 03:44 PM
Last Post: bowlofred
  How to timestamp a Python program, your thoughts? Orthoducks 2 4,671 Dec-02-2016, 12:06 AM
Last Post: Orthoducks

Forum Jump:

User Panel Messages

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