Python Exercise Example 88
**Problem:** Read 7 integer values (1-50); each time a value is read, the program prints that many asterisks (*).
**Analysis:** None.
Example
#!/usr/bin/python
-- coding: UTF-8 --
if
name
==
'
main
'
:
n
=
1
while
n
<=
7
:
a
=
int
(
raw_input
(
'
input a number:
\n
'
)
)
while
a
<
1
or
a
50
:
a
=
int
(
raw_input
(
'
input a number:
\n
'
)
)
a
'
'
n
+=
1
The output of the above example is:
input a number:
9
*********
input a number:
5
*****
input a number:
6
******
input a number:
Python 100 Examples