Ask coding questions

← Back to all posts
how does this code works ?
Iamvik98 (1)

here i have used "input function" inside "print statement". when i run this code it prints "There are no. of hours until midnight" and then ask asks me to enter an "input value" and that's it, when i hit enter after entering an "input value", it just print outs that value again in the next line and not print outs the print statement("There are no. of hours until midnight) with "no. of" replaced by the "input value" that i have entered.
how can i get the desired output here ??

Answered by MrVoo (96) [earned 5 cycles]
View Answer
Comments
hotnewtop
MrVoo (96)

You did the syntax wrong, it should be no_of = input('Hours until midnight: ')