guessagain - guess = input('Guess a number between 1 and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% 3/2/11 % Exam 1 Practice % Write a script to prompt a user to guess a number between 1 and 100, % and keep asking the user to guess until they enter the correct number, % which is 25. % again = 1; while again == 1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: guess = input('Guess a number between 1 and 100:\n'); if guess ~= 25 disp('Try again.'); else disp('Correct!'); end again = input('Would you like to guess again yes(1) or no(0)?\n'); end e...
View Full Document

Ask a homework question - tutors are online