Computer Science, asked by NidhraNair, 1 year ago

_________________________
hello;)
___________________________
class 11 python!

what's the output for question no 11
don't spam..¡?¿!
_______________________

Attachments:

Answers

Answered by Anonymous
5

Hi,

Actual output is in screenshot.. here I will explain you.

<<<First of all I wanna clear that print will always print whatever you have passed to it on new line.>>>

name = input("What is your name?");

in above line we are taking input from user and then saving that string in name variable.

print("Hi", name, ',')

in above line we are printing the string Hi name (remember name will be entered by user)

print("How are you doing?")

and the above code will print How are you doing? on the next line.

So now you understood that why you did not get the indented output.

To get the intended output all you have to do write the second if statement content in first print statement like so:-

print("Hello", name, ', How are you doing?');

Attachments:

NidhraNair: can u help in the other question.. I have asked.. question 13¡¡!! 25 ponits !!
NidhraNair: so that some other question is not answered ;-)
NidhraNair: there are many other questions.. but I got the answer.. so I mentioned the question no. and points. .. so that u don't answer the other one.......
NidhraNair: got it?
NidhraNair: ;)
Similar questions