Python Forum
could someone explain keywords, marks, and function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
could someone explain keywords, marks, and function
#11
Hi Jefsummers
I am a medical doctor from Saigon, Vietnam. I graduated long time ago and practiced there for 8 years in family medicine. I came to the US and I passed all the medical licensing examinations, there are 4 of them totally, i studied on my own and passed all of them. They are the same examinations as for the domestic trained MDs.

Well, that is not enough for the licensing system, I still could not get my MD license to practice medicine because age and race discrimination I am unable to get a residency that would grant me my license.

I have very strong background and knowledge and lots of experiences in healthcare and medicine in the US for working here in various positions in healthcare for the last 10 years.

I just discovered data science last year 2019 and I really want to turn into this direction. Well, i know data sciences apply for anything and everything. indeed, medicine and healthcare use a lot of data sciences.

So I hope I can learn the skills and can return to work in healthcare using both of my healthcare background and skills plus this DS skills. or I can do any other industry.

thanks for asking.
Katherine
Reply
#12
Like @ndc85430 I am unfamiliar with these horizontal/vertical aspect you refer to and frankly in my opinion its usefulness is doubtful when it comes to computer languages. I have always learned new language in terms of concepts like, variables, operators/operator precedence, expressions, data structures, branching, loops, functions, OOP, etc. Once you are familiar with concepts in general learning new language becomes relatively easy - get to know particular syntax and gramar.
Looking at your example - it's incomplete, both in terms of missing "marks" and missing use cases. Some examples
  • missing triple quotes ''' and """
  • missing operators (look at expressions and operator precedence in particular)
  • missing * and ** for packing/unpacking
  • ... # this list could continue
  • missing use cases in almost all of the examples/explanations (i.e. it's incomplete and that's the main problem when trying to create such list)

Also
print("Hello, world!")  # double quotes
print ('Hello, world!') # single quotes and space between the function and the parameter
Note that:
  1. The space between print and opening bracket is not required and is actually against PEP8 recommendations - no space between function and opening bracket in function calls. The use of space in this case is not related to the use of " vs ' quote as implied by the explanations.
  2. what they call parameter is not parameter, it's an argument list (in this case - actually single argument) in brackets. See the difference between arguments and parameters.
  3. using sum as variable name should be avoided as it overrides the built-in function sum
  4. what they call array is called list in python (again - incorrect use of terminology)
  5. PEP8 recommends use of space on both sides of = in assignment operations (i.e. num2=2 is not recommended)

I could continue, but you get my point.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#13
pip3 install balack
Then create a file with some code inside:

Output:
{'glossary': {'title': 'example glossary', 'GlossDiv': {'title': 'S', 'GlossList': {'GlossEntry': {'ID': 'SGML', 'SortAs': 'SGML', 'GlossTerm': 'Standard Generalized Markup Language', 'Acronym': 'SGML', 'Abbrev': 'ISO 8879:1986', 'GlossDef': {'para': 'A meta-markup language, used to create markup languages such as DocBook.', 'GlossSeeAlso': ['GML', 'XML']}, 'GlossSee': 'markup'}}}}}
Then run black on this source file.
Then Output:
Output:
{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"], }, "GlossSee": "markup", } }, }, } }
The formatter black is very opinionated, but it formats the code in a way, that it's useable with git.
So if you make a diff of formatted code and not formatted code, you get the better results with formatted code.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#14
I posted a railroad diagram of python's grammar in this thread.
Reply
#15
Hi Grib and Deadeye

thanks for your examples.
i like the rainroad diagram, it is impressive and a lot to follow.
thanks
Katherine
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Identifying keywords in text drchips 6 91,830 Mar-29-2022, 12:32 PM
Last Post: snippsat
  Customize Python Keywords for IDLE alanvers 0 1,995 Apr-03-2021, 10:56 AM
Last Post: alanvers
  Please explain uncommon way of declaring and using variable [function.variable] esphi 4 2,324 Nov-07-2020, 08:59 AM
Last Post: buran
  How to instantly add quotation marks and comma for parameters? cheers100 4 8,051 Oct-22-2020, 12:51 PM
Last Post: cheers100
  local variable 'marks' referenced before assignment Calli 3 2,321 May-25-2020, 03:15 PM
Last Post: Calli
  how to explain this function run? PY_beginner 3 2,189 Oct-04-2019, 10:09 PM
Last Post: ichabod801
  Can I search from Python, automatically and randomly generated keywords in Google? xX_Prophit_Xx 0 2,295 Sep-07-2018, 04:43 PM
Last Post: xX_Prophit_Xx

Forum Jump:

User Panel Messages

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