#https://www.programiz.com/python-programming/online-compiler/ #https://www.online-python.com/ #https://www.programiz.com/python-programming/examples #definice promenne # integer - obecna promenna numerickeho charakteru ''' typy datovych promennych v pythonu: Text Type: str Numeric Types: int, float, complex Sequence Types: list, tuple, range Mapping Type: dict Set Types: set, frozenset Boolean Type: bool Binary Types: bytes, bytearray, memoryview print(f'Sum of {a} and {b} is {sum(a, b)}') print(f'Sum of {a} and {b} is {sum(a, b)}') fruits = ["apple", "mango", "orange"] #list numbers = (1, 2, 3) #tuple alphabets = {'a':'apple', 'b':'ball', 'c':'cat'} #dictionary vowels = {'a', 'e', 'i' , 'o', 'u'} #set print(fruits) print(numbers) Zuzana Benova 14:30 (30 minutes ago) to 30102, 30137, 25641, Ondřej #Definice proměnných number = 10 number = 100 print(f'Vypiš proměnnou {number}') # Online Python - IDE, Editor, Compiler, Interpreter # Jak se komentuje v Pythonu - napisu krizek na zacatek radky ''' Zakomentovávání delších odstavců: I am a multiline comment! "halohalo halo tenhletxt python cist nebude" ''' #vypise ahoje svete print('Ahoj svetě, teď budeme počítat počet nohou pětinohého tvora') #definice souctu (sum) #def sum(a, b): # return (a + b) def sum(pocet_nohou_kocky, c): return (pocet_nohou_kocky + c) #a = int(input('Enter 1st number: ')) #b = int(input('Enter 2nd number: ')) c = int(input('Zadej kolik nohou chceš přičíst: ')) #c = 1 pocet_nohou_kocky = int(input('Zadej pocet nohou kocky: ')) print(f'Celkový počet nohou petinohé kočky je {pocet_nohou_kocky} a {c} je {sum(pocet_nohou_kocky,c)}') #print(f'Sum of {a} and {b} is {sum(a, b)}') #print(f'Soucet promenne jedna {a} a promenne dve {b} je {sum(a, b)}') # Online Python - IDE, Editor, Compiler, Interpreter # Jak se komentuje v Pythonu - napisu krizek na zacatek radky ''' Zakomentovávání delších odstavců: I am a multiline comment! "halohalo halo tenhletxt python cist nebude" typy datovych promennych v pythonu: Text Type: str Numeric Types: int, float, complex Sequence Types: list, tuple, range Mapping Type: dict Set Types: set, frozenset Boolean Type: bool Binary Types: bytes, bytearray, memoryview ''' #vypise ahoje svete print("Hello World") #definice souctu (sum) def sum(a, b): return (a + b) a = int(input('Enter 1st number: ')) b = int(input('Enter 2nd number: ')) a, b, c, d = 5, 3.2, "Hello", 1000 print (a) print (b) print (c) print (d) ''' print(alphabets) print(vowels)