I am getting the correct word for this but how do I make it a coherent sentence. Currently it has spaces between each variable.
NIC E J ob!
Nice Job!
import string
x = "NICK" # First 3 characters
y = "DE JAVU" # 1 to 4 characters
z = "Bob!" # Last 3 characters
x1 = x[0:3]
y1 = y[1:4]
z1 = z[-3:]
def main():
print(x1,y1,z1)
main()
x = "NICK" # First 3 characters
y = "DE JAVU" # 1 to 4 characters
z = "Bob!" # Last 3 characters
def main():
raw_line = x[0:3] + y[1:4] + z[-3:]
result = " ".join(map(str.capitalize, raw_line.split()))
print(result)
main()
>>> 'Nice Job!'