Small Python Project (3)


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


Pseudo Code:

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.

Keahlian: Python, Perancangan Perangkat Lunak

Lihat lebih lanjut: interesting python projects, python small projects, python project ideas for beginners, intermediate python projects, python projects list, python mini projects with source code, python projects for practice, python project for beginners, small python project example, small illustration project, outstanding project manager summary qualifications, will small java project, small screen project excel, small html project, adding big integer number using linked list, small projects project bids online, small computer project, broker small freelance project, count number times character appears document, count number times given character occurs array characters

Tentang Pemberi kerja:
( 3 ulasan ) Austin, United States

ID Proyek: #17825450

Diberikan kepada:


Hello, I am experienced excel expert. I can help with this task with quick turnaorund. Looking to hearing from you. Kind regards

$30 USD dalam 1 hari
(47 Ulasan)

2 freelancer menawar dengan rata-rata $28 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

$25 USD dalam 1 hari
(2 Ulasan)