Python: Simple Function example

In Python, to define a function is very easy. use the def to define a function, you can then call the function directly by name. For example:   #function example def mod_string(msg): msg += " modified! " return msg   test_str = "this is a test" print(mod_string(test_str)) The example function simply append ” modified” to […]

C#: how to write in-line code in new Event Handler Declaration

Normally, you need to declare a new Event Handler and give this new event handler a name, then write the function inside the new event handler function to complete the code. However, you can skip that by writing in-line code inside a declaration of new event handler. copyToolStripMenuItem.Name = "copyToolStripMenuItem"; copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); […]