Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How can use a variable in an input statement and print a comma after a variable with no space?

Avatar of Barbara69
Barbara69Flag for United States of America asked on
Programming Languages-OtherPythonScripting Languages
2 Comments1 Solution348 ViewsLast Modified:
Is there a way to use a variable in an input statement such as miles = int(input(name, 'How many miles to be converted to kilometers?: ')). When I tried this I got TypeError: input expected at most 1 arguments, got 2.
Also, I have print(name,'the conversions for your data are as follows: \n') and I would like to put a comma after name which is a variable without a space. I've tried name, ',' + 'the conversions for your data are as follows: \n', but I get a space between name and the comma.
Avatar of pepr

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers