Run the following user interface.
Enter your name and expected year of your graduation: <you enter your name> <semester year>
Then, your Python code returns:
<your name> will graduate in <semester year>
For example, if you enter Adam Smith fall 2020
Then, your code will display
Adam Smith will graduate fall 2020
name=input("Enter name: ")
semester=input("Enter semester: ")
year=input("Enter year: ")
print("{} will graduate in {} {}".format(name,semester,year))
#using function
def func(name,semester,year):
return name+ " will graduate in "+semester+" "+year
name=input("Enter name: ")
semester=input("Enter semester: ")
year=input("Enter year: ")
print(func(name,semester,year))
Get Answers For Free
Most questions answered within 1 hours.