Why this code is not showing proper result | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why this code is not showing proper result

age = int(input()) name = input() if age>=18: print("Welcome"+ name) else: print('Sorry')

9th Dec 2022, 5:41 PM
34 Akash
34 Akash - avatar
4 Answers
+ 9
# add a space print("Welcome "+ name)
9th Dec 2022, 5:48 PM
Oma Falk
Oma Falk - avatar
+ 4
print('welcome', name)
9th Dec 2022, 6:04 PM
Harsha S
Harsha S - avatar
+ 2
Or like this with a formatted string literal: print(f"Welcome {name}")
10th Dec 2022, 5:57 PM
Paul
Paul - avatar
+ 1
print('Welcome %s'%(name))
10th Dec 2022, 6:59 PM
Harsha S
Harsha S - avatar