Azure-Samples / cognitive-services-personalizer-samples

Samples for the Microsoft personalizer
MIT License
54 stars 76 forks source link

User input for giving reward or quitting requires quotation marks to work #35

Closed bbentley19 closed 5 years ago

bbentley19 commented 5 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run sample.py, input information until Personalizer makes a recommendation. Enter either y or n and press Enter. Also works with q for quit.

Any log messages given by the failure

raceback (most recent call last): File "sample.py", line 77, in answer = input("Is this correct?(y/n)\n")[0] File "", line 1, in NameError: name 'y' is not defined

Expected/desired behavior

Entering in y or n (or q for quit) should work as that is what the prompt text instructs the user to do.

OS and Version?

macOS (Yosemite? El Capitan? Sierra?) macOS High Sierra

Versions

Mention any other details that might be useful

Using VSCode


Thanks! We'll be in touch soon.

edjez commented 5 years ago

@diberry FYI

diberry commented 5 years ago

@edjez @bbentley19 I verified this sample works on macOS Mojave 10.14.6 as written. I didn't need to enter my responses in quotes.

    (venv) dinas-Air:python dfberry$ python sample.py
    What type of food would you prefer? Enter number 1.salty 2.sweet
    1
    What time of day is it (enter number)? 1. morning 2. afternoon 3. evening 4. night
    2
    Personalizer service ranked the actions with the probabilities listed below:
    salad : 0.333333343
    ice cream : 0.333333343
    juice : 0.0
    pasta : 0.333333343
    Personalizer thinks you would like to have salad.
    Is this correct?(y/n)
    y
    Press Q to exit, any other key to continue: q

This isn't a reproducible issue.

diberry commented 5 years ago

please-close