Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
29 lines (18 loc) · 863 Bytes

File metadata and controls

29 lines (18 loc) · 863 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def sum_function(first, second):
return (first + second)
print("Sum: ", sum_function(5, 10))
def sum_arbitrary_arguments(first, *rest):
return (first + sum(rest))
print("Sum with arbitrary number of arguments: ", sum_arbitrary_arguments(5, 10,15))
print("Sum with arbitrary number of arguments: ", sum_arbitrary_arguments(5, 10,15, 20, 25, 30))
def print_weather(name, state = "New York", temp = "30 degrees Celsius"):
print("Hi {}, it is {} in {}".format(name, temp, state))
print_weather("Sarah")
print_weather("Mike", "Boston", "28 degrees Celsius")
def print_weather_kwargs(**kwargs):
weather_report = ""
for argument in kwargs.values():
weather_report += argument
return weather_report
kwargs = { 'temp':"30 degrees Celsius ", 'in':'in', 'State':" New York", 'when': ' today'}
print(print_weather_kwargs(**kwargs))
Morty Proxy This is a proxified and sanitized view of the page, visit original site.