Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
November 11th, 2012, 08:35 PM
 djagoude217
Registered User

Join Date: Nov 2012
Posts: 1
Time spent in forums: 27 m 14 sec
Reputation Power: 0
Python generate n points

generate N point show the n points generated at the console. Zone must be bounded by the "=" symbol and all multiples of 5 are marked with the symbol + and mutiples 10 with the # symbol :
if x_max is 10 and y_max is 10
n=3 and are (1,1) (2,3) (5,4)
we shoul have

=1 ===+==== #=
= x . . . . . . . . .=
= . . . . . . . . . .=
= . x . . . . . . . .=
= . . . . . . . . . .=
+ . . . x . . . . . .+
= . . . . . . . . . .=
= . . . . . . . . . .=
= . . . . . . . . . .=
= . . . . . . . . . .=
= . . . . . . . . . .=
=1====+====#=

#2
November 12th, 2012, 12:52 PM
 b49P23TIvg
Contributing User

Join Date: Aug 2011
Posts: 4,132
Time spent in forums: 1 Month 3 Weeks 2 Days 5 h 47 m 38 sec
Reputation Power: 455
Code:
```grid=[list('.'*10)for i in range(10)]
grid[2][3] = 'x'
print('\n'.join(' '.join(L) for L in grid))```
__________________
[code]Code tags[/code] are essential for python code!

 Viewing: Dev Shed Forums > Programming Languages > Python Programming > Python generate n points