Re: Polls for Dummies
uselessness, on host 65.33.139.87
Saturday, June 8, 2002, at 06:36:09
Polls for Dummies posted by Quartz on Friday, June 7, 2002, at 15:13:00:
> Am I the only one that doesn't understand a word of the poll? Do I need anything explained to me? Finally, and most importantly, would I understand any explainations?
I'm not entirely familiar with Python, but it appears to be a programming language similar to C and a whole bunch of other similar languages. I don't know C, but I do know JavaScript and PHP, both of which share some things with the poll choices.
The topic in question seems to be a standard logic statement, like...
if($momsays == "clean your room"){ / / / / cleanroom(); } elseif($momsays == "take out the trash"){ / / / / takeouttrash(); } else{ / / / / partyhard(); }
In other words, if Mom says to clean your room, clean your room. If she doesn't say that, but instead says to take out the trash, take out the trash. If she says neither, well, just party. Of course, my example is highly simplified.
The code I wrote above is PHP syntax, and Pyton syntax seems to be different. But I can guess what each thing does because of terms that are the same across the board, like "if" and "else." I also recognize "for/else" and "while/else," which are loops. Here's an example for that...
$clothesonfloor = 10; while($clothesonfloor >= 1){ / / / / pickupshirt(); / / / / $clothesonfloor --; / / / / echo("You pick up one shirt. ".$clothesonfloor." remain."); }
In other words, a function continues to occur until a certain condition has been met. In this example, the script begins with 10 shirts on the floor. The loop begins, picking up one shirt each time, and the number of clothes on the floor decreases by one (that's what "--" means). Next, it writes "You pick up one shirt. 9 remain" onscreen. Then it checks again if there are any shirts still on the floor. If there are, it'll pick up another. And it continues to do this until all the shirts are gone. Again, my example in in PHP, but Python is likely similar.
Now, I don't know anything about "try/except/finally," "raise," "break," or "continue." I assume they are all similar in function, because the poll is asking for your favorite way to do one thing. I voted for "while/else." :-)
-useless"I'd take programming over Three Stooges any day!!"ness
|