Frequently Asked Python Program 18:Find Smallest & Largest Numbers in a List

preview_player
Показать описание
Topic : Find Smallest & Largest Numbers in a List

#########################
Udemy Courses:
#########################

Manual Testing+Agile with Jira Tool
************************************

Selenium with Java+Cucumber
********************************

Selenium with Python & PyTest
********************************

Selenium with python using Robot framework
****************************************

API Testing(Postman, RestAssured & SoapUI)
*****************************************

Web & API Automation using Cypress with Javascript
********************************************

Playwright with Javascript
**************************

Jmeter-Performance Testing
************************

SDET Essencials(Full Stack QA)
*************************

Appium-Mobile Automation Testing
************************************

Java Collections
*****************

Python Programming
*********************

Cucumber BDD Framework
***************************

Protractor with Javascript
***************************

####################################
Youtube Playlists:
####################################

Manual Testing & Agile
***********************

SQL
*************************

linux & Shell Scripting
**********************

Java
**********************

Selenium With Java+Cucumber
********************************

Python
********************************

Selenium With Python,Pytest&Behave
***************************************

Selenium With Python Using Robert Framework
(Web&API Testing)
*************************************************

API Testing (Postman,SoapUi,&Rest Assured)
**********************************************

Mobile App Testing Appium
****************************

Performance Testing Jmeter
*******************************

Maven,Jenkins,Git,Github,CI/CD
*******************************

SQL,DB Testing&ETL,Bigdata
*******************************

JavaScript Based Automation Tools
********************************

Selector Hub Tools
********************

GraphQL
******************

Cypress API Testing
********************

Cypress Web Testing
**********************

Playwright with Javascipt
**************************

#PythonProgramming
#ListManipulation
#MinMaxNumbers
#ListOperations
#CodingChallenge
#PythonLists
#FindMinMax
#NumberManipulation
#ListAlgorithms
#CodePractice
#PythonCoding
#AlgorithmDesign
#SmallestAndLargest
#CodingSolutions
#PythonFunctions
#ListIteration
#TechInterview
#CodingSkills
#AlgorithmTips
#PythonTips
#ProgrammingLogic
#DataStructures
#PythonSnippets
#CodeExamples
#ListTraversal
#CodingInPython
#ProgrammingProblems
#PythonLearning
#CodingCommunity
#Programming101
#AlgorithmExplained
#CodingMadeEasy
#PythonTricks
#CodeOptimization
#ProblemSolving
#CodingJourney
#PythonDevelopment
#SoftwareEngineering
#AlgorithmMastery
#ProgrammingLanguages
#CodingInspiration
#PythonCodeSnippets
#ProgrammingChallenges
#CodeDebugging
#PythonExploration
#CodingGenius
#AlgorithmPatterns
#PythonProjects
#LearnToCode
#CodeMentorship
Рекомендации по теме
Комментарии
Автор

arr=[1, 1, 2, 3, 4, 5]
count=0
for i in range(1, len(arr)):
if arr[i-1]<arr[i]:
max=arr[i]
print('', max)
for i in range(1, len(arr)):
if arr[0]<=arr[i]:
min=arr[0]
print('', min)

rajupadhyaya-mbgx
Автор

list=[1, 3, 5, 7, 5, 3, 15, 3, 2, 14, 300, 44, ]
smallest=list[0]
largest=list[0]
for i in range(len(list)):
if list[i]>smallest:
smallest=list[i]
if i<largest:
largest=list[i]
print(largest)
print(smallest)

matthewmark
Автор

Thanks a lot.. Really appreciate your effort. Keep uploading frequently asked python programs. It's very helpful.

anuradhakumari
Автор

Thanks so much i am understand to you verry well 🙏🏻

eng.mariamalhussainy
Автор

arr = [5, 8, 1, 4, 7, 0]

def adding(arr, i, min, max, second_max):
if i >= len(arr):
return min, max, second_max
if arr[i] > max:
max = arr[i]
if arr[i] < min:
min = arr[i]
if arr[i] > second_max and arr[i] < max:
second_max = arr[i]
return adding(arr, i+1, min, max, second_max)
print(adding(arr, 0, arr[0], arr[0], arr[0]))

kvelez
Автор

L1=[2, 3, 1, 5, 4, 9, 7, 6]
Min, Max=L1[0]
For i in range(lL1):
If L1[i] < Min:
Min =L1[i]
If L1[i] > Max:
Max=L1[i]
Print(Min, Max)

visionstatus
Автор

y = None
for x in [20, 100, 20, 1, 10]
if y is None :
y = x
elif x < y
x = y
print(y)

jarvisstart
Автор

But in interviews they are asking same question, but they are asking solve this problem with out using min max list methods, how to approach it

profoundlearnings
Автор

How to find the minimum value if it is case sensitive
For example
[1, 2, 2, 3, 4]

pratheepparamasivam
Автор

Sir is sort function works if list contains negative numbers

murali.j
Автор

but tjis code is not working for negative numbers

SujanaReddy-zzcn
Автор

Arrange numbers from smallest to largest

iinjm
Автор

N = input()
list_N = N.split()
length_of_list_N = len(list_N)
sum = 0
for i in list_N:
sum = sum + int(i)
average = sum/length_of_list_N
average = round(average, 2)
print(average)

kanurisuresh
Автор

If the list contain the negative numbers

gshaik
Автор

Where are you from my friend? I am learning English too. Funny accent btw, and excellent video!

Nicollas
Автор

mylist=[1, 3, 65, 87, 100]

max=0

for i in range (0, len(mylist)):
if mylist[i]<min:
min=mylist[i]
if mylist[i]>max:
max=mylist[i]
print(min)
print(max)

visheshsingh