Adding two strings

A problem with your message format is that for students who you did not enjoy teaching, you don't want to tell them It's False that I enjoyed having you as a student. You want to only include the positive note for specific students.

As the first step to doing this, you decide to break out the message into two parts.

1
2
3
4
5
6
7
8
name = 'Aditya'
score = 98
liked = True

message = "Hi %s. You achieved a score of %d." % (name, score)
extra = "It's %s that I enjoyed having you as a student." % liked

print message + extra

What do you get as the output?

×

Problem Loading...

Note Loading...

Set Loading...