How to find max and min of a tuple with Python

2 Answers

0 votes
t = (3, 5, -2, 1, 99, 55)


print(max(t))
print(min(t))


'''
run:

99
-2

'''

 



answered Oct 31, 2018 by avibootz
edited Nov 2, 2018 by avibootz
0 votes
t = ('java', 'python', 'c', 'php', 'c++')

print(max(t))
print(min(t))


'''
run:

python
c

'''

 



answered Oct 31, 2018 by avibootz

Related questions

1 answer 291 views
1 answer 285 views
1 answer 247 views
2 answers 332 views
1 answer 211 views
1 answer 236 views
1 answer 200 views
...