Hello everyone!, Id had some fun with *args lately. Im my own words *args is a parameter that can accept any amount of non – keyword arguments and is thought as using a tuple. Here a script for you to enjoy.
# lets create a list of the top ten hawks in utah def top_ten_hawks_in_utah(*args): print("Here are the top 10 hawks in Utah:") counter = 0 for hawk in args: counter +=1 print(f"Number {counter}:{hawk}") print("hawk") top_ten_hawks_in_utah("Red tailed Hawk", "Northern Harrier", "Coopers Hawk", "Swainson's Hawk", "Sharp-Shinned Hawk", "Rough legged Hawk", "Ferruginous Hawk", "Northern Goshawk", "Common black Hawk", "Zone-tailed Hawk")
submitted by /u/Upper-Abroad-5868
[link] [comments]
r/learnpython Hello everyone!, Id had some fun with *args lately. Im my own words *args is a parameter that can accept any amount of non – keyword arguments and is thought as using a tuple. Here a script for you to enjoy. # lets create a list of the top ten hawks in utah def top_ten_hawks_in_utah(*args): print(“Here are the top 10 hawks in Utah:”) counter = 0 for hawk in args: counter +=1 print(f”Number {counter}:{hawk}”) print(“hawk”) top_ten_hawks_in_utah(“Red tailed Hawk”, “Northern Harrier”, “Coopers Hawk”, “Swainson’s Hawk”, “Sharp-Shinned Hawk”, “Rough legged Hawk”, “Ferruginous Hawk”, “Northern Goshawk”, “Common black Hawk”, “Zone-tailed Hawk”) submitted by /u/Upper-Abroad-5868 [link] [comments]
Hello everyone!, Id had some fun with *args lately. Im my own words *args is a parameter that can accept any amount of non – keyword arguments and is thought as using a tuple. Here a script for you to enjoy.
# lets create a list of the top ten hawks in utah def top_ten_hawks_in_utah(*args): print("Here are the top 10 hawks in Utah:") counter = 0 for hawk in args: counter +=1 print(f"Number {counter}:{hawk}") print("hawk") top_ten_hawks_in_utah("Red tailed Hawk", "Northern Harrier", "Coopers Hawk", "Swainson's Hawk", "Sharp-Shinned Hawk", "Rough legged Hawk", "Ferruginous Hawk", "Northern Goshawk", "Common black Hawk", "Zone-tailed Hawk")
submitted by /u/Upper-Abroad-5868
[link] [comments]