Concatenating python strings, integers, and floats as input

as a newbie, i am building an app that computes user bio data.
i want to set the strings and integers as input then concatenate what ever the user inputs, but I am having bugs in my code.
can anyone help out?

here is the code below!!


def out_put():
  yourName = input
  surName = input
  
  computeYourBioData = yourName + surName
  return computeYourBioData

print("Welcome To The book")
print("What's your name? ")
yourName = input("please enter your name: ")
print("What's your Surname? ")
surName = input("please enter your Surname: ")


computeYourBioData = out_put()
print(computeYourBioData,"welcome")

I need more clarification on concatenation

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

You’ve already stored the input in these variables. What do you intend to accomplish with these lines? (You can delete them.)

You need to pass your yourName and surName variables to your function.
https://www.w3schools.com/python/gloss_python_function_arguments.asp

The concatenation is basically correct.

Thanks! :muscle: :muscle: :muscle: :muscle: :muscle: :muscle: :muscle: :muscle:Worked out

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.