26 AnswersNew Answer
https://code.sololearn.com/ceveJF53m6Sl/?ref=app U code is running . But why still u have problem in that..🤔
Devang But for me it's running alright. Can u tell me what u gave input to it.
Devang See the code which I had shared above it's working . And it's the one which u have written .
Please show error message
Hi Devang, I think you are entering the input like this "Devang 17" . This will give error as your program requires 2 inputs separated by a newline \r\n character. Try inputting like this ( by pressing nextline on keypad ): Devang 17 This will give you correct result. Regards Roshan
Just change the age into int
Not working in mine miracle
a = input ("Enter your name: ") b=int(input("Enter your age: ")) print("Hello!" ,a,"You are ", b) #My attempt
💖..₥łⱤ₳₵ⱠɆ..💖 sorry but it's showing error
Should work with no problems and for the people commenting use "+" instead of "," and cast age as int.. you can print anything and everything using "," but with an automatic space whereas "+" is used for concatenation of strings, in which case you have to cast numbers and all as str().
its actually working, you just need to input in this format "example 17"
You did great with the input but you need to concatenate the strings using "+" Like this print("Hello " + a +"You are "+ str(b))
Alto this would invoke a ValueException. I wrote in my reply that he/she should use str() to cast the variables to the string type. Sadly people think its okay to simply concatenate different types and disregard the add operator. Sure you might have no issues now but irl and outside of python, so the rest of the programming field, you will have massive issues with implicit variables.
Wheres8 yeah ur write but he only need to typecast the integer For the age print("You are "+str(b)) Is not it
@Alto Logically correct but its always good practise to make sure everything is right. You dont know what the user will send for both a and b, always good to take caution. Beginners who had Python as their first language have massive understanding issues when it comes to languages like C, C++, Java etc... Dont even look at 8086 Assembly. I think python should be used as a quick hacky language that you use because you already have programmed network sockets etc... in C and need to test stuff. It takes away so much learning and real world information such as pointers or programming logic (python: all wrapped in one function but the beginner doesnt/will never know what happens beneath the hood).
B = int(input())
There's nothing error in your code because I tried it in pydroid 3 and it's working.
This code is not working when You have only 1 input lane in "input". If U press enter/return and create new lane this work fine. Else not work and got crashed coz of SoloLearn.
HEY, BRO THIS NOT IDE THIS ANDROID APP HOW TO WORK FOLLOW ME RUN CODE SUMIT OPTION ONLY ONE TIME OPTION value add NAME AGE ___________________________ SUMIT OUTPUT DEAD 0