4 ms·
In Python you even have the shortcut 5 < x < 10.
by giomasce 11y ago
In Python you even have the shortcut 5 < x < 10.
- jimcsharp 11y agoThis is the first programming hangup I can remember having. Thinking "Why can't I just write it like this?"
- bryanlarsen 11y agoYou just triggered an old man anecdote. We got our first computer on the morning of Dec 25th. We figure out how to plug it into the TV and we turn it on. It turns on, and we get a flashing cursor. Now what? Aren't you supposed to be able to play games on these? The only other thing we have is the BASIC manual. Let's start reading this. So I play with it for a bit, writing programs like '10 print "Bryan is the Master of the Universe"; 20 goto 10'. On the 26th I decide that the first program I should write is a program to randomly pick BINGO numbers. It looks something like this: 10 X=RND(75) 20 IF X=1 OR 2 OR 3 OR 4 OR 5 OR 6 OR 7 OR 8 OR 9 OR 10 OR 11 OR 12 OR 13 OR 14 OR 15 THEN PRINT "B" ... It took me a couple of hours to get IF statement to work. But I did, and here I am over 30 years later...
- giomasce 11y agoI did not know about this instead, and the first time I knew about it I would not believe my friend telling me. I had to try.