to @c.a.m.gerlach
to @hansgeunsmeyer
to @shankarsivarajan
Good day. When I was learning class, after reading the textbook, I wrote my own programs imitating the demo example. The main purpose of these programs was to display the contents between the 3 sets of inverted commas (the original wordings by the Singaporean author Dr. Teik Toe Toeh). The attached 3 files are the 3 programs that I wrote. Please pore over them and kindly tell me what errors I had made which prevented the contents between the 3 sets of quotation marks to show up as the correct results. Thanks for your great help.
Itās not always easy to see in certain fonts, but the names of special attributes in Python have two underscores beginning and end (ādouble underscoreā or ādunderā). What you want here is __doc__
rather than _doc_
. That should make it work I think!
@Rosuav : youāre 100% correct. Please take a look at the attached file. Million thanks. May I ask you a question? Did you study Computer Science in college?
That looks like itās working! And no, I never went to college, never studied CS.
@Rosuav Gee, you never went to college. Then, how and when did you start to learn Python? Otherwise, you were born highly intelligent !!!
Python specifically? I first met it in the 1990s, merely as a curiosity; back then, most of my work was done in REXX, and it served me just fine. My first serious use of Python was in about 2008, I think, when I sought to deploy it as an embedded scripting language in the companyās flagship application. After that, it quickly joined my arsenal of languages, and I became involved in the community in a number of ways. For a while, I was teaching a programming bootcamp, and was able to make some small use of Python there (it was primarily full-stack JavaScript, but the students had a special one-week section where they could learn something else of interest, and Python was a popular - and excellent - choice), and my āday jobā now involves a mix of languages, including Python.
Thank you Though intelligence is available to anyone who wants to work on it. Learning a language like Python is a great start; learning how to spot bugs is also a worthwhile skill (and one that carries across different languages as you learn them). Keep at it, and you will soon be an expert yourself!
After that, it quickly joined my āāāarsenal of languages, āāā May I inquire how many computer languages can you speak? My thesis of MS was written in C back in 2001 and C is the only one I can speak fluently. Several months ago, I decided to learn Python by myself 'cause I thought Python is the best tool to master AI which is of great potentials. Based on my experience, Python is much more like human language than C. Itās the 1st time that I met the term āinverted commasā. You can see in my 5th attempt to learn class, I even copied and pasted 3 sets of inverted commas from MS office Word trying to solve the problem even though I expected it wouldnāt work. After all, inverted commas are human language, rather than computer language. However, my strong curiosity pushed me do in this way and I eagerly wanted to know what kind of ErrorMessages would show up. Itās fun.
A lot On a regular basis, I mainly use Python, Pike, JavaScript, and to a lesser extent C. Depending how you count, bash scripting, SQL, and other tools, may also factor in. But when thereās a need, Iāll use whatever language fits the situation: Lua, C++, Java, C#, SourcePawn, Ruby, even PHP (but only if someoneās paying me). Iāve used literally hundreds of languages over the years, most of which arenāt particularly relevant to anything
That is true, and in fact, I usually hear the term āinverted commasā when discussing scare quotes, rather than in a programming context. But the term is well defined.
@Rosuav Gee, donāt tell me you can speak machine language and directly think in 01110111, 11110000 , and so on and so forth when writing computer programs. Rumors said John von Neumann could directly think in machine language and he was the only person whom I know had this incredible ability. But rumors are only remors. No proof or credible witness testimony can confirm these rumors.
No, although I do have some basic familiarity with 80x86 assembly code Itās way WAY easier to think in high level programming code.
@Rosuav In short, youāre a human being, not an alien. Might I inquire how many human languages you can speak?
Fluently? One.But this part is debated:
Since one of your original problems was caused by non-ascii quotes, it may interest you to know that you can use (some) non-ascii as variable names in Python:
from dataclasses import dataclass
@dataclass
class éä¼ ē®ę³:
äŗŗå£č§ęØ”: int
ēŖåē: float
äŗ¤åę¦ē: float
def č·ę„(self):
# do stuff
You cannot use emoji, though ā which is pretty inconsistent, I think But I recently found out that if you really want to, then there is pythonji (its actual name is
), which allows you to do things like
import pandas as š¼
The 5-year-old in me is wondering what would happen if we flood the GitHub with pythonji codeā¦
(Would it screw up the AIs or help them in their rebellion against their masters?)
Itās quite amusing watching GitHub Copilot at work. I have a custom web front end library called The Chocolate Factory, and when one of my clients (I donāt have Copilot myself) is working on some code that uses it, Copilot will sometimes attempt to represent JQuery idioms using Choc Factory syntax. So my prediction is: You would start to see non-Python code using emojis, resulting in vast numbers of novice C, Ruby, and JS programmers attempting to use emoji variable names and filing bug reports about them not working.
Unsure whether this would be a net gain or loss for the world.
@Rosuav : I speculate you can speak Russian due to your surname, Italian your middle name. So at least you can speak English, Russian, and Italian. What else?
@hansgeunsmeyer : Hans, great to see you again. I live in the Republic of China, Taiwan and we adopt the orthodox(AKA, complicated) Chinese. I assume you live in the states, and you use simplified Chinese. Question: Simplified Chinese is the normal choice for people living in the states who want to learn Chinese to adopt?
Ah, I wish that were true⦠My surname is not Russian, although people have said my username looks it. My actual surname is indeed Italian but aside from picking up a few phrases here and there, I donāt speak the language. (I am, however, fluent in Italian food. Learned from an early age that the correct amount of garlic is ālotsā and the correct amount of cheese is āis that even a questionā.) No, the only human language I am truly fluent in is English.
That said, though, I do enjoy listening to Twitch streamers in a variety of languages, and sometimes watch movies in different languages (but I need subtitles to understand more than the occasional word). And I was once involved in a production of an Italian opera, which was good fun; but, again, needed to have a translation in order to fully follow along.
@Rosuav : I am a great fan of US movies Godfather 1 , 2, and the Untouchables(1987) starring Andy Garcia (in the movie his name George Stone, but actually Giuseppe Petri. A lying member of a no good race) Have you watched the Untouchables? The Untouchables 1987 Extract The Team (youtube.com)
Have not, but then, I donāt watch many movies
@Rosuav : I deeply admire your computer knowledge. Can you be my friend on FB? My FB account is Hans Gruber Zhang. It will be my great honor to have a friend like you on FB. My friend list on FB is very short, so far, only 14. 2 years ago , a person with Russian names asked me to be his/her friend on FB. His/her FB posts were about drinking mostly. We never left posts on each oneās FB pages. 1 year later, he/she suddenly disappeared from FB.