Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Sort-three-variables/Python/sort-three-variables-1.py
Normal file
11
Task/Sort-three-variables/Python/sort-three-variables-1.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#python2 Code for Sorting 3 values
|
||||
a= raw_input("Enter values one by one ..\n1.").strip()
|
||||
b=raw_input("2.").strip()
|
||||
c=raw_input("3.").strip()
|
||||
if a>b :
|
||||
a,b = b,a
|
||||
if a>c:
|
||||
a,c = c,a
|
||||
if b>c:
|
||||
b,c = c,b
|
||||
print(str(a)+" "+str(b)+" "+str(c))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
while True:
|
||||
x, y, z = eval(input('Three Python values: '))
|
||||
print(f'As read: x = {x!r}; y = {y!r}; z = {z!r}')
|
||||
x, y, z = sorted((x, y, z))
|
||||
print(f' Sorted: x = {x!r}; y = {y!r}; z = {z!r}')
|
||||
Loading…
Add table
Add a link
Reference in a new issue