-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson6.py
28 lines (23 loc) · 947 Bytes
/
lesson6.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
print("Dragon's mother said \"No\"")
# Escaped sequences
print("- Are you hungry?\n-Aaaaaraagh!")
print("Gregor Clegane\nDunsen\nPolliver\nChiswyck")
print("Joffry loves using \\n")
# Concatenation
# The operator is the same as when adding numbers, but here it has a different meaning (semantics)
print('Dragon' + 'stone')
print('Kings' + 'wood') # => Kingswood
print('Kings' + 'road') # => Kingsroad
print("King's" + 'Landing') # => King'sLanding
# We put space in the left part
print("King's " + 'Landing') # => King's Landing
# We put space in yhe right part
print("King's" + ' Landing') # => King's Landing
# LABS
# TASK
# Write a program that displays:
# - Did Joffrey agree?
# - He did. He also said "I love using \n".
# !! In this case, the program uses only one print(),
# but the result on the screen should look exactly as shown above
print("- Did Joffrey agree?\n- He did. He also said \"I love using \\n\"." ) # => PASS TEST