0 points

Name, Variables, Code, Function


dashboard

Mon Jun 08 2020 12:40:22 GMT+0000 (UTC)

Posted by @Amna #python

# this is like your scripts with argv
def print_two(args):
    arg1, arg2 = args
    print(f"arg1:{arg1}, arg2: {arg2}")
 
# this just takes one argument
def print_one(arg1):
    print(f"arg1:{arg1}")
    
# this one takes no argument
def print_none():
     print?("I got nothin',")
content_copy Copy

The lines after # are comments. Python will ignore these comments when the program runs.

https://www.amazon.com/Learn-Python-Hard-Way-Introduction/dp/0134692888/ref=pd_lpo_14_img_0/145-2038954-9524128?_encoding=UTF8&pd_rd_i=0134692888&pd_rd_r=ef9c42e9-dfb9-4aa7-bd28-d4ef80f17296&pd_rd_w=aAQyc&pd_rd_wg=p8R5U&pf_rd_p=7b36d496-f366-4631-94d3-61b87b52511b&pf_rd_r=Y77J2N1H3EECZQ618R8B&psc=1&refRID=Y77J2N1H3EECZQ618R8B