Write a program that asks the user to guess a number between 1 and 50 in as few attempts as possible. The program should count the number of user attempts to guess the number.
This program should include a while loop and use the [login to view URL]() function
Obtain a random number between 1 and 50 and store it in a variable.
Create another variable to store the guessed Number.
Create third variable to count the number of times it takes the user to guess the number.
While the number to guess does not equal the guessed number:
Prompt the user to guess a number between 1 and 50.
Convert the number to an integer.
If the guessed number equals the number to guess, print, "You got it in # attempts", where # is the number of attempts it took to guess the number.
Otherwise, if the guessed number is less than the number to guess, print: "Higher"
Otherwise, if the guessed number is greater than the number to guess, print: "Lower"
Use a main() function.
3 freelancer menawar dengan rata-rata $27 untuk pekerjaan ini
Hello, An experienced python developer is here to help you out. I will give you quality product within time frame you'll give to me. Please consider my bid and send details via chat Regards