I have a question for Python.

Asked 2 years ago, Updated 2 years ago, 11 views

I'm solving this simple problem, but it's not working. Please help me When I run it, I get soso... And you need to input the number of people, but I was testing that I put 3 in the function parameter value

[Input] The first line is given the number N (1 수N (1101, where N is an odd number). The next N lines are given an integer for each line to indicate what opinion each person expressed in the survey. 0 means that Junhee said he was not cute, and 1 means that Junhee said he was cute.

[Output] If there are more opinions that Junhee is not cute, print out "Junhee is not cute!" If there are many opinions that Junhee is not cute, print out "Junhee is cute!"

Example

Input

3
1
0
0

Output Junhee is not cute!

 def isJunheeCute(people) :
    choice = 0
    result = []
    noCute = 0
    yesCute = 0

    if people % 2 != 0 :
        while people < 0:
            choice = int (input ("cute 1, not cute 0"))
            result.append(choice)
            people = people -1

        for i in result:
            if result[i] ==0:
                noCute = noCute +1
            else :
                yesCute = yesCute +1
        if noCute > yesCute:
            print("junhee is not cute")
        elif noCute<yesCute:
            print("junhee is yes cute")
        else:
            print("soso")

    else:
        print ("Odd Names Only")


isJunheeCute(3)

python

2022-09-22 08:56

1 Answers

I've just worked on a code that works well and I'll give you a rough hint.

From now on, your homework! Give that a try.


2022-09-22 08:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.