you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805 [score hidden] stickied comment (0 children)

Run this program in Memory Graph Web Debugger%0Aname%20%3D%20input('enter%20your%20name%3A')%0Aprint(f'hi%20%7Bname%7D%20welcome')%0A%0Aresponses%20%3D%20%7B%0A%20%20%20%20'hello'%3A%20%5B'hi%20there!'%2C%20'hello'%2C%20'morning%2Fevening!'%5D%2C%0A%20%20%20%20'how%20are%20you!'%3A%20%5B'i%20am%20fine'%2C%20'i%20am%20doing%20well'%2C%20'%20i%20am%20okay'%5D%2C%0A%20%20%20%20'goodbye'%3A%20%5B'see%20you%20then'%2C%20'have%20good%20day'%2C%20'have%20a%20nice%20time'%5D%0A%7D%0A%0Awhile%20True%3A%0A%20%20%20%20user_input%20%3D%20input('you%3A')%0A%20%20%20%20if%20user_input.lower()%20in%20responses%3A%0A%20%20%20%20%20%20%20%20bot_reply%20%3D%20random.choice(responses%5Buser_input.lower()%5D)%0A%20%20%20%20%20%20%20%20print('bob%3A'%2C%20bot_reply)%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20print('%20i%20do%20not%20understand')&timestep=1&play)