Skip to content

Commit

Permalink
St 23.10.2013 11:43
Browse files Browse the repository at this point in the history
	new file:   mat_fce.py
	new file:   podminky_cykly.py
	deleted:    podminky_cykly
  • Loading branch information
MarrekNozka committed Oct 23, 2013
1 parent 6458bd8 commit 4bfcbed
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
37 changes: 37 additions & 0 deletions mat_fce.py
@@ -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()
30 changes: 30 additions & 0 deletions podminky_cykly.py
@@ -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!!!'

0 comments on commit 4bfcbed

Please sign in to comment.