TI/Skrypty z zajęć/1: Różnice pomiędzy wersjami
Z Brain-wiki
(Utworzono nową stronę "<source lang="python"> #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 25 12:29:30 2020 @author: tgub """ #x=10 # #if (x>0): # a=5 #else: #...") |
|||
Linia 69: | Linia 69: | ||
</source> | </source> | ||
+ | |||
+ | |||
+ | [[category:Programowanie dla Neuroinformatyków]] |
Wersja z 10:09, 26 lut 2020
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 25 12:29:30 2020
@author: tgub
"""
#x=10
#
#if (x>0):
# a=5
#else:
# a=10
#
#if (x>0): a=5
#else: a=10
#
#a = 5 if (x>5) else 10
#x=10
#while True:
# print(x)
# if (x<0): break
# x=x-1
#mx = 100
#s = 0
#lista = [(1,2),(49,100),(50,3),(10,4)]
#i = 0
#
#tup = (1,2)
#a = tup[0]
#b = tup[1]
#a,b = tup
#for x,y in lista:
# n=x+y
# if n>100: continue
# print(x+y)
#
#a = 1
#b=10
#
#def fun(x):
# b = x**2
# return a+b
#
#print(fun(5))
x = 6
def fun(x):
x += 1
def fun1(y):
global x
x += y
fun1(x)
return x
x = 7
print(fun(x))
print(x)