In: Computer Science
Write a short program that performs the following:
- Method city returns the string "Seattle":
- Method named state returns the string "Washington ":
- Method named report calls the city methodand calls the state method. and prints their return values, so that the output will appear as : "Seattle Washington "
Solution:
#method city return string Seattle
def city():
return "Seattle"
#method state return string Washington
def state():
return "Washington"
#method report calls above two method
def report():
#calling city()
c=city()
#calling state()
s=state()
#printing the required return values of two methods
print(c,s)
report()
Note: If you find any error in the above code it may be due to improper indentation occurred while copying the code ,so please provide proper indentation with the help of above image
If you find my answer helpful,please give thumbs up,Thank you