Printing two strings

Uh-oh. In the previous problem,

1
print message + extra

did not give you the output you wanted, because the two sentences came out stuck together, with no space after the period in the first sentence.

You decide to try again. How do you edit your program:

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

so that the output for Aditya is:

1
Hi Aditya. You achieved a score of 98. It's True that I enjoyed having you as a student.
×

Problem Loading...

Note Loading...

Set Loading...