Python defines code blocks (known as suites in Python) using white space and colons.
def somemethod(name):
if name == "Michael":
print("Hi old friend")
else:
print("Nice to meet you")
print("My name is ...")
def main():
somemethod()
Pytnon language Demo
# wather.py
import random
# public List<String> GetDays()
def get_days():
# List<String> days = new List<String>();
days = []
days = ['mon', 'tues', 'wed', 'thurs', 'fri', 'sat', 'sun']
return days
def get_random_report():
weather = ['sunny', 'lovely', 'cold']
return weather[random.randint0, len(weather)-1]
def main():
days = get_days()
for day in days:
report = get_random_report()
print("On {0} it will be {1}.".format(day, report)
if __name__ == "__main__":
main()