Python 88
[Python 100] Python 100
7150
#!/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'))
print a * '*'
n += 1
input a number: 9 ********* input a number: 5 ***** input a number: 6 ****** input a number:
[Python 100] Python 100
yanice
672***[email protected]
#!/usr/bin/python # -*- coding: UTF-8 -*- import random # 3 1~10 num=[] s=['*'] for i in range(0,3): num.append(random.randint(1,10)) print " * :",num[i] print '*'*num[i]yanice
672***[email protected]
fxy***[email protected]
Python3
#!/usr/bin/python3 import random for i in range(1,7): a = random.randint(0,50) print(a,'\n') for j in range(0,a): print('*',end='') print('\n')fxy***[email protected]
pjdssjdcr
735***[email protected]
# -*- coding: utf-8 -*- from __future__ import print_function for i in range(7): n = int(raw_input('a number:\n')) for j in range(n): print('*',end = '') print('')pjdssjdcr
735***[email protected]
tiantian
120***[email protected]
#encoding=utf-8 for i in range(7): a=int(raw_input("enter a number(1-50): ")) if a<0 or a>50: a=int(raw_input("enter a number(1-50): ")) print "*"*atiantian
120***[email protected]