Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
42 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,42 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf8 -*- | ||
# Soubor: vstupVystup.py | ||
# Datum: 06.11.2013 09:06 | ||
# Autor: Marek Nožka, nozka <@t> spseol <d.t> cz | ||
# Licence: GNU/GPL | ||
# Úloha: demonstrace vstupu a výstupu | ||
############################################################################ | ||
|
||
a = input('zadej cislo: ') | ||
print(a) | ||
print(type(a)) | ||
|
||
b = raw_input('zadej znak: ') | ||
print(b) | ||
print(type(b)) | ||
|
||
radek = raw_input('neco misem napis: ') | ||
seznam=radek.split() | ||
print(seznam) | ||
print(type(seznam)) | ||
|
||
i=0 | ||
while i<len(radek): | ||
print(radek[i]) | ||
i=i+1 | ||
|
||
i=0 | ||
while i<len(seznam): | ||
print(seznam[i]) | ||
i=i+1 | ||
|
||
cisla=raw_input('zadem mi cisla, ja udelam prumer :') | ||
cisla=cisla.split() | ||
print cisla | ||
|
||
i=0 | ||
suma=0.0 | ||
while i<len(cisla): | ||
suma = suma+float(cisla[i]) | ||
i=i+1 | ||
print(suma/len(cisla)) |