By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,583 Members | 1,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,583 IT Pros & Developers. It's quick & easy.

How do I print a variable value into a string

P: 1
I'm rather new to programming, I'm trying to create a program that inputs your name and then prints something like print(user_value)"Have a good day").
Dec 7 '19 #1

✓ answered by dev7060

Use the '+' operator to concatenate strings.

Expand|Select|Wrap|Line Numbers
  1. val = input()
  2. print(val + ", have a good day!")
  3.  

Share this Question
Share on Google+
1 Reply


Expert 100+
P: 203
Use the '+' operator to concatenate strings.

Expand|Select|Wrap|Line Numbers
  1. val = input()
  2. print(val + ", have a good day!")
  3.  
Dec 7 '19 #2

Post your reply

Sign in to post your reply or Sign up for a free account.