Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new file: mat_fce.py new file: podminky_cykly.py deleted: podminky_cykly
- Loading branch information
1 parent
6458bd8
commit 4bfcbed
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Spyder Editor | ||
This temporary script file is located here: | ||
/home/marek/.spyder2/.temp.py | ||
""" | ||
|
||
import pylab | ||
import math, copy | ||
|
||
#x = [1, 2, 3] | ||
#y = [5, 2, 8] | ||
#pylab.plot(x,y,'o-') | ||
|
||
x=[0.0] | ||
y=[math.sin( x[-1] )] # x[-1] je poslední hodnota v seznamu | ||
while x[-1] <= 4 : | ||
x = x + [ x[-1]+0.8] # přidám do seznamu číslo o 0.1 větší než je poslední hodnota | ||
y = y + [ math.sin( x[-1] ) ] # do seznamu y přidám funkční hodnotu pro poslení x | ||
|
||
pylab.plot(x,y) | ||
|
||
# Vytvořím druhý seznam a budu ho midifikovat tak abych dostal | ||
# absolutní hodnotu | ||
absy = copy.deepcopy(y) | ||
|
||
i = 0 | ||
while i<len(y): | ||
absy[i] = abs( absy[i] ) | ||
i=i+1 | ||
|
||
pylab.plot(x,absy) | ||
|
||
|
||
|
||
pylab.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf8 -*- | ||
|
||
a=input('zadej cislo: ') # funkce input vrací číslo tj. int, float | ||
aa=a | ||
#a=raw_input('zadej retezec') # funkce vrací řetězec | ||
#a=int(a) | ||
|
||
|
||
if a==0: | ||
print 'A je NULA' | ||
b='ANO' | ||
else: | ||
print 'A je nenulové' | ||
b='NE' | ||
print 'Tohle se napiše vždy' | ||
|
||
|
||
while a > 0 : | ||
a=a-1 | ||
print a | ||
print 'A tohle je konec!!!' | ||
|
||
print '###################################' | ||
|
||
while aa>0: | ||
aa=aa-1 | ||
if aa%2 == 0 : # a je sude | ||
print aa | ||
print 'A tohle FAKT je konec!!!' |