Coding Exercise for Beginners in Python |Exercise 15 | Python Tutorials for Beginners #lec45

preview_player
Показать описание
Python program to find maximum number from a list of numbers ( Don't use max() and len() functions and take use input using input() function)
hint: use split() and range() functions

*********************************************

Connect & Contact Me:

*******************************************

More Playlists:

#coding #pythonforbeginners #python #jennyslectures #pythonprogramming #loop
Рекомендации по теме
Комментарии
Автор

Another way:
list1 = []
user_input = input("Enter numbers with space separated: ").split()
for i in user_input:
list1.append(int(i))
list1.sort()
print(list1[-1])

Rayray-cdsz
Автор

numbers = input("Enter Numbers:")
list_numbers = numbers.split()
list_numbers.sort()
max_1 = list_numbers[-1]
print(max_1)

gouthamlingoju
Автор

Thank u so much maam for this course playlist students like me who r from different background like commerce can also understand this course

vaishnavidhage
Автор

# maximum number in a list
number=input("Enter number in a list ")
number_list=number.split()
count=0
for counts in number_list:
count+=1
for numbers in range(count):

print("Maximum number in a list ", max(number_list))

ssogntm
Автор

SHARRADHA DIDI TO ESE HI FAMOUS H . YOU ARE LEGEND MAM😇

hiteshgehlot
Автор

num = input("enter the value separated by comma ")
number = num.split(", ")
length = len(number)
for i in range(length):
number[i] = int(number[i])
number.sort()
print(number[-1])

research
Автор

l=input('enter vales separeted by spaces ').split()
count=0
max=0
for i in l:
count=count+1
for i in range(count):
l[i]=int(l[i])
for i in range(count):
if max<l[i]:
max=l[i]


print(f"maximum values is {max}")

seenumadhavan
Автор

#Program to find the maximum number from a list of numbers
list1 = []
list1 = input("Enter a list of numbers separated by a comma ', ': ")
list_updated = list1.split(', ')
#print(type(list_updated))
#print(list_updated)
counter = 0
for i in list_updated:
counter += 1
#print(counter)
for i in range(counter):
list_updated[i] = int(list_updated[i])
max = list_updated[0]
for i in range(counter):
if list_updated[i] > max:
max = list_updated[i]
print(f"The max number from the list is: {max}.")

sigmatronX
Автор

num = input("enter the list of number seprated by comma : ")
list = num.split(", ")
count = 0
for i in list:
count += 1

for i in range(count):
list[i] = int(list[i])
print(list)
sort_val = list.sort()
lenght = len(list)
max_val = list[lenght - 1]

print("Maximum value of list is :", max_val)

bhautikhirpara
Автор

n = input("enter number sepprated by space")
number = n.split( )
max = 0
for i in number:
i = int(i)
if i>max :
max = i
print("maximum number from list is", max)

RahulSingh-cwcn
Автор

user_input = input("Enter numbers separated by spaces: ")
num_list = user_input.split(" ")
highest_num = 0
for high in num_list:
num_in_list = int(high)
if highest_num < num_in_list:
highest_num = num_in_list
print(f"{highest_num} is the highest number in the given.")

King-rmuc
Автор

numbers = input("Enter the numbers seperated by spaces: ").split(" ")
count =len(numbers)
count2 = count-1
greater = 0
for i in range(count) :
numbers[i] = int(numbers[i])
else :

for i in range(count2):
if numbers[i] > numbers[i+1] :
greater = numbers[i]
else :
greater = numbers[i+1]
print(f"The greater number is {greater}")

umairmughal
Автор

Another Way:
n = input("Enter numbers seperated by comma(, ): ")
numbers = n.split(', ')
max = 0
for i in numbers:
if max < int(i):
max = int(i)
print(f"The max number is {max}")

abirbagchi
Автор

# Note: Using max() is not allowed

numbers = input("Enter the numbers separated by space: ").split()
Max = 0

for i in numbers:
Int = int(i)
if Int > Max:
Max = Int

print(Max)

I did it in this way, is it ok or errorprone? However it's working properly

manimperfext
Автор

numbers=input("Enter list of numbers : ")
number_list=numbers.split(" ")

number_list.sort()

count=0
for i in number_list:
count=count+1

for i in range(count):


print(f"Maximum number : {number_list[count-1]}")

Ma'am can this be one of the alternate method??

aishwaryagandhi
Автор

l1 = input("Enter the no. Separated by comma").split(', ')
l2 = []
count = 0
maximum = 0
for i in l1:
l2.append(int(i))
count2 = 0
for j in l2:
if l2[count] > l2[count2]:
maximum = l2[count]
count2 += 1
count += 1
print(maximum)

prakhargupta
Автор

list1 = [int(x) for x in input().split()]
max =0
count = 0
for i in (list1):
count = count+ 1
for i in range(count):
if max<list1[i]:
max =list1[i]
print(max)

Fullstackdeveloper
Автор

num=input("Enter the num:")
num1=[int(x) for x in num.split()]
for t in num1:
print(t)
max=num1[0]
for t1 in num1:
if t1 > max:
max=t1;
print("Maximum number is:", max)
o/p:
Enter the num:33 11 22 44 10
33
11
22
44
10
Maximum number is: 44

suyogpardeshi
Автор

Mam please continue C++ course also please please 🙏🙏🙏🥺🥺 completed C full playlist and eagerly waiting for C++ full course please continue mam ❤

paavaneep
Автор

another video coming on the same day ☺️ hat's off your hard work Mam love you ❤😂

johngkitvsr