diff --git a/Seth_A99501/day15.ipynb b/Seth_A99501/day15.ipynb new file mode 100644 index 00000000..fcb6b3f8 --- /dev/null +++ b/Seth_A99501/day15.ipynb @@ -0,0 +1,58 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "87\n", + "2\n" + ] + } + ], + "source": [ + "def max_min():\n", + " #creating a list of numbers.\n", + " list=[2,4,5,6,7,34,56,67,87,23,5]\n", + " \n", + " #initializing theee value of max and min respectively.\n", + " max_value=list[0]\n", + " min_value=list[0]\n", + " #iterate through the list\n", + " for i in range(len(list)):\n", + " if list[i] > max_value:\n", + " max_value=list[i]\n", + " elif list[i] < min_value:\n", + " min_value=list[i]\n", + " print(max_value)\n", + " print(min_value)\n", + "max_min()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}