Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Trying to create a question using a previously given answer (beginner)

Name=input("What is your characters name?")
print("                                                        ")

print("Warrior")
print("Knight")
print("Sorcerer")
print("Cleric")

Class=input("What class is", Name ) 

Traceback (most recent call last):
  File "main.py", line 58, in <module>
    Class=input("What class is", Name ) 
TypeError: input expected at most 1 argument, got 2
 
KeyboardInterrupt
 

Got this response. Please Help

I am new to the software so please refrain from using any advanced jargon.
Thank you.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

this is because the input isn’t like print, you can’t pass multiple arguments and it joins them in spaces, so you should do:

Name=input("What is your characters name?")
print("                                                        ")

print("Warrior")
print("Knight")
print("Sorcerer")
print("Cleric")

Class=input(f"What class is {Name}" ) 
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading