In Python Unterricht: Ansehen 2020 Complete Python Bootcamp: From Zero To Hero

It sounds like you're referring to the (often by Jose Portilla on Udemy) and asking for a piece of teaching material from it.

show_info(1, 2, 3, name="Alex", age=25) Write a function build_profile that accepts a first name, last name, and arbitrary keyword arguments ( **kwargs ). Return a dictionary with all the information. Solution: It sounds like you're referring to the (often

greet(John="Hello", Anna="Hi") def show_info(*args, **kwargs): print("Args:", args) print("Kwargs:", kwargs) Anna="Hi") def show_info(*args

def build_profile(first, last, **kwargs): profile = {"first_name": first, "last_name": last} profile.update(kwargs) return profile print(build_profile("Eric", "Liddell", sport="Running", medal="Gold")) If you meant you want a from that exact 2020 bootcamp, please clarify and I can recreate that style exactly. kwargs) def build_profile(first

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button