+ 2

Correct the code:

Code: inp=input("inp=") a=input("a=") if(a=="Hi"): inp Explanation: I'm trying to use an input as a code so I can modify my code whenever I want. Help me in how to execute the variable inp I gave the inp as print("Hello") and a as Hi According to the code,The first input is stored as inp and a is just to start the next step. If a is equal to Hi, it should execute inp.But nothing is happening and a message that the program ends was diplayed. Please help me out with this! (Am using Atom editor)

2nd Feb 2018, 7:37 PM
PERVEZ SAYAD
PERVEZ SAYAD - avatar
2 ответов
+ 1
It looks like Python to me. Anyways... You can define functions that do whatever you want, then use if statements within main to call functions according to inputs. If I got it right.
2nd Feb 2018, 8:48 PM
Pedro Demingos
Pedro Demingos - avatar
0
its which language pls mention
2nd Feb 2018, 7:40 PM
java fan
java fan - avatar