What is the simplest method to get a vector result?

Marko Rauhamaa marko at pacujo.net
Thu Jul 24 16:25:52 CEST 2014


fl <rxjwg98 at gmail.com>:

> I have read a lot about Python, but it still has a problem now on a
> simple exercise. For example, I want to generate a sine curve.

Here you go:

========================================================================
#!/usr/bin/env python3

import math

for x in range(0, 361, 15):
    print(int((math.sin(x / 180 * math.pi) + 1) * 30 + 0.5) * " " + "*")
========================================================================


Marko



More information about the Python-list mailing list