YouTip LogoYouTip

Python Exercise Example88

# Python2.x Python Exercise Instance 88 [![Image 3: Python 100 Examples](#) Python 100 Examples](#) **Question:** Read 7 integer values (1β€”50), and for each value read, the program prints out that number of *s. **Program Analysis:** None. ## Instance ```python #!/usr/bin/python # -*- coding: UTF-8 -*- if __name__ == ' __main__ ': n = 1 while n<= 7: a = int(raw_input('input a number:n')) while a50: a = int(raw_input('input a number:n')) print a * '*' n += 1 The output of the above instance is: input a number: 9 ********* input a number: 5 ***** input a number: 6 ****** input a number: ``
← Python Exercise Example89Python Exercise Example87 β†’