l=input('enter heights separated by space').split() sum=0 count=0 for i in l: sum+=int(i) for i in l: count=count+1 avg=round(sum/count) print(f"average height is {avg}")
@white-hat6664 ай бұрын
total wrong
@sayyedirshad99413 ай бұрын
@@white-hat666It is giving the correct output.. then how it is wrong
@Fullstackdeveloper138 ай бұрын
list1 = [int(x) for x in input().split()] #we can directly take input from user and convert it into a list and values into integer form with this 1 step..thank me later😉😉
@PushpendraSinghDangi11 ай бұрын
no need to use double "for loop" or "range", if we are not disturbing input list, the following approach can more efficient height=input("enter height list separated by space:").split() total_height=0 count=0 for i in height: i=int(i) total_height+=i count=count+1 else: print(round(total_height/count))
@jjjmemes4207 ай бұрын
Yes, i also did the same
@sumanthsathala17905 ай бұрын
but when we add float values it rerturns error
@abebebiru1701 Жыл бұрын
I started following you in 2019. You make everything about CS simple even where looks hard. That is why I love learning from you! You are the best and keep it up, Jenny!
@cbidcpbhargavips490114 күн бұрын
lis = list(map(int, input("Enter the Elements: ").split())) sum = 0 for i in lis: sum += i length = len(lis) print(sum/length)
@AmanMomin-sj7sd6 ай бұрын
heights = input("Enter value by space").split() sum = 0.0 j = 0 for i in heights: j +=1 sum += int(i) else: print(i) avg = sum // j print(avg)
@chakalikrishna9257Ай бұрын
List1=list(map(int, input( ). split ( ))) Count=0 Sum1=0 For i in list1: Sum1= sum1+i Count=count+1 Avg=sum1/count
@murakondamanasa552 Жыл бұрын
a=input("enter list of numbers seperated by comma's(,)") list=a.split(",") sum=0 j=0 for i in list: sum=sum+int(list[j]) j=j+1 avg=sum // j print(f"sum= {sum} and average= {avg}")
@sivachintada649 Жыл бұрын
print("Enter The marks Of The Students Sepearte each by using ,") a = (input()) marks_list = a.split(",") print(marks_list) sum = 0 lenght = 0 for i in marks_list : sum+=int(i) lenght+=1 avg = sum / lenght average = round(avg) print(average)
@midnightphantom47875 ай бұрын
Hey I did this too
@venkateswarlugoud4564 Жыл бұрын
Excellent explanation mam even who don't know about coding they can also easily understand your lectures🎉🎉❤❤😊
@prakhargupta7687 Жыл бұрын
l1 = input("enter the Hight Seprated by comma").split(',') total_height = 0 count = 0 for i in l1: total_height += int(i) count += 1 print(round(total_height / count))
@umairmughal78926 ай бұрын
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}")
@Harsha.1084 ай бұрын
hei=input("enter heights separated by comma : ") heig=hei.split(",") print("heights : ",heig) s,c=0,0 for i in heig: s+=int(i) c+=1 h=round((float(s/c)),0) print("avg height is",int(h))
@decentboys1351 Жыл бұрын
Great explanation by great teacher🎉🎉😅
@notkrish94052 ай бұрын
for those who don't want to use range function my coding can help ( 2 extra line of code) , it is not written in good way reply to it if you want me to change it a=input("enter some heights: ") b=a.split(',') d=[] print(b) for j in b: c=int(j) print(c) d.append(c) print("the list is:",d) sum=0 count=0 for k in d: sum=sum+k count=count+1 print(round(sum/count)) Goodluck ;)
@MonishaRajakumar-v8m Жыл бұрын
height_list = input("enter your list: ") height_list1 = height_list.split(',') sum = 0 count = 0 avg = 0 for i in height_list1: sum += int(i) count += 1 avg = sum / count print(round(avg))
@kushalroy5663 Жыл бұрын
p=[ ] j=int(input("enter the no of people")) print(f"enter the height of {j}people individually ") sum=0 for i in range(j): p.append(int(input())) for i in (p): sum=sum+int(i) sum=sum//5 print(sum)
@DARK_RYZEN Жыл бұрын
user_input=input("enter a number by giving space") spilitted=user_input.split(" ") count=len(spilitted) for i in spilitted: sum_of_all_height_value=int(spilitted[0])+int(spilitted[1])+int(spilitted[2])+int(spilitted[3]) print((s/count))
@itsmylife4048Ай бұрын
As per the instructions here, you cannot use len() function...
@deekshithaparasu Жыл бұрын
height=input("enter the heights:") z=height.split() print(z) sum=0 for i in z: sum=sum+int(i) print("the sum of the heights in list is ",sum) x=len(z) avg=sum/x print("the average of given heights is:",int(avg))
@makupetrical0037 ай бұрын
numbers = input('Enter a list of numbers: ').split(' ') t_sum = 0 print(f'numbers are the following {numbers}') Numbers = [] for i in numbers: Numbers.append(i) t_sum +=int(i) average = t_sum//len(numbers) print(Numbers) print(f'sum = {t_sum}') print(f'average is {average}
@kasunpriyadarshana5850 Жыл бұрын
h = input("Enter height list") height = h.split(' ') height_sum = 0 count = 0 for i in height: height_sum += float(i) count += 1 average = round(height_sum/count, 2) print(f"Average is {average}")
@rajraj-df8sk Жыл бұрын
heights = [] user_input = input("Enter heights of all separated by commas: ").split(',') for i in user_input: heights.append(float(i)) print(heights) sums = 0 lengths = 0 for j in heights: sums = sums + j lengths = lengths + 1 average = round(sums // lengths) print(f"Average is {average}")
@ruxhant49072 ай бұрын
sum=0 L=[] count=0 height=input("Enter heights with comma as separation") list=height.split(",") for i in list: L.append(int(i)) count+=1 for j in L: sum+=j avg_height=sum/count r=round(avg_height) print(f"The avg height is:{r}")
@itsmylife4048Ай бұрын
Hello Ma'am, one of the terms I have learned from you is "Dry run" 😃
@dsc40sundar18 Жыл бұрын
heights = [] lsi = input(":enter the heights of students by seperated comma:").split(',') for i in lsi: heights.append(float(i)) print(heights) print(type(heights)) for i in range(len(heights)): print(type(heights[i])) su = 0 count = 0 for j in heights: su = su + j count = count + 1 print(su) print(count) avg = int(su//count) print(f"the average is :{avg}")
@sagarekunde3889 Жыл бұрын
hgt=input() list1=hgt.split(" ") print(list1) a=0 b=0 for ht in list1: a=int(ht)+a b=b+1 average=a/b avg=round(average) else: print(f'average={avg}')
@VISHNUMURALY-f3q10 ай бұрын
print('AVERAGE HEIGHT') ans=0 count=0 height=input('Enter heights separated by comma :') separated=height.split(',') print(separated) for i in separated: count = count + 1 ans=ans+int(i) average=ans/count print(f'Average height :{round(average)}')
@InfantaA Жыл бұрын
number = input("enter the numbers: ") number_list=[] count=0 total=0 number_list = number.split(" ") print(number_list) for i in number_list: total+=int(i) count+=1 avg=total/count print("%.2f"%avg)
@venkateswarlugoud4564 Жыл бұрын
I am watching your python series since morning I love your videos❤❤❤
@vigneshk5193 Жыл бұрын
Excellent explanation mam. Keep continuing this course
@MaDmAxLoCaL Жыл бұрын
My Version: #Average of the numbers inp=input('Enter your input:') l=inp.split(',') s=0 c=0 for i in l: s=s+int(i) c=c+1 a=s/c print(s) print(c) print(f"Average={round(a)}") #Average
@akarahjonathan2227 Жыл бұрын
your lesson is. V ery easy to unstand
@fitoremorina2894 Жыл бұрын
Thank you for your videos Jenny! Your videos are very helpful! Go on!☘
@karthikeyasarma283 Жыл бұрын
heights = (input("Enter height of each person in meters: ")) height_List = heights.split(",") length = 0 for i in height_List: length+=1 print(f"length of input = {length}") sum_height=0 for j in range(length): height = int(height_List[j]) sum_height = sum_height + height print(f"sum of height = {sum_height}") average_height = sum_height/length print(f"average height = ",round(average_height),"cm")
@gurukiran447629 күн бұрын
thanks for everything ma'am 🤩
@learncode5798 Жыл бұрын
Thank YOU Mam...!!!🙂
@adupaharshith756410 ай бұрын
H = input().split() C = 0, S = 0 For i in H: C += 1 S += int(i) Print(round(S/C)) I think it is more shorter than we think😅
@rupayadav256 Жыл бұрын
Jenny , I didnt understood the line total=total + person(Why person was incrementing). Please explain, it will be helpful to understand the 3rd part total concept.
@manfredmasiko4444 Жыл бұрын
Superb 👍👍
@mjmr-official- Жыл бұрын
Excellent
@sandhyatoleti52886 ай бұрын
h = input("enter your heights: ") count, total = 0,0 height = h.split(",") for i in height: total=total+int(i) count=count+1 average = total/count print(round(average))
@ganeshganesh-ww8oi4 ай бұрын
You are a great
@KEVIN11-ty1go Жыл бұрын
I love your videos ❣️ And way of teaching 😊
@sumayyakhan2004 Жыл бұрын
I was watching your videos since 3 hrs now. Cuz I've my externals from 17th. 😭😭
@JennyslecturesCSIT Жыл бұрын
Good luck 👍
@mr_affan15 Жыл бұрын
Then why u express 😭 this emoji 😅
@SudhakarRaja-y4n Жыл бұрын
height = input("Enter the heights separate with comma(,) in cm : ") count = height.count(',')+1 height = height.split(',') total = 0 for i in height : total +=int(i) print(round(total/count))
@systembreaker4864 Жыл бұрын
Shortest solution 🎉🎉🎉
@MyCodingDiary Жыл бұрын
Your content is amazing, I just subscribed!
@sanataniladka1083 Жыл бұрын
Love from bihar❤
@DilshadAdk Жыл бұрын
heights=input("Enter heights sperated by ','") # user enter input splited_height=heights.split(",") # splited by "," int_height=[] #create emty list sum=0 3 #initialise the base value of sum for height in splited_height: #converted splited string list into integer num=int(height) int_height.append(num) #appended the converted value 1 by one into the emty list for i in int_height: #calculated the total of the numbers on by one usig fthis loop sum=sum+i total=sum #assigned total into a variable count=len(int_height) #find length of the list average=(sum/(count)) #then find simply average print(f"Average height={average}") #result if any sajession mistake please replay😍
@MyCodingDiary Жыл бұрын
You're killing it with your content, just subscribed to support you!
@tamilselvan.s0394 Жыл бұрын
What about using FLOOR DIVISION for round of values😅
@vigneshsankar4922 Жыл бұрын
U r my lovely cute tutor🎉 Lote of love from great TaMiLnaDU.
@moscow_naresh_putin7 ай бұрын
its not great
@thulasiramnaik7294 Жыл бұрын
nice🤗
@LawalHammedTunde2 ай бұрын
What if in a situation whereby alphabets are received from the user instead of numeric literal? This kind of exception needs to be considered.
@akkiaksahya123rd9 ай бұрын
h=input("enter the heights with space:") k=h.split(",") print(k) con=0 count=0 for j in k: count=count+1 print("the number elements are",count) for i in k: con=(con+float(i)) l=con/count print(f"the avg of elements is {round(l)}") I DIDNT USED ANY RANGE FUNCTION /SUM/LEN
@sucharithapatnana2946 Жыл бұрын
Thank you mam
@MrSaurabh Жыл бұрын
@SAMEENASHAIK-el6yr Жыл бұрын
Given a coordinate (x, y). The task is to calculate the number of steps required to reach point (x, y) from (0, 0) following zig zag route. You cannot travel in a straight line for more than 1 unit. Also, you are required to start moving along Y-axis Input: 4 4 Output:8 mam please solve this code send me
@MyCodingDiary Жыл бұрын
Your videos are so informative and entertaining, I just subscribed!
@JESUS_FOR_EVERYTHING Жыл бұрын
mam artifical intelligence some videos cheyandi
@johngkitvsr170 Жыл бұрын
Unexpected time the video is coming love you mam 😉❤
@JennyslecturesCSIT Жыл бұрын
Well I like to give surprises sometimes 😁
@johngkitvsr170 Жыл бұрын
yeah 😂 Mam ☺️👍
@travelspurs Жыл бұрын
Hyeee 😍😍😍❤️❤️ beauty 💕 though this lecture about Java is very good 🙂
@incomparablevikkie550710 ай бұрын
I assume if the user does not put space to all the numbers inputed, how do we takw care of that.
@sanataniladka1083 Жыл бұрын
First comment❤
@karthickkishor7807 Жыл бұрын
I am have small program code 😂 A=input('enter your height 1') B=input('enter your height 2') C=input('enter your height 3') D=input('enter your height 4') E=input('enter your height 5') Sum=A+B+C+D+E average_height=sum/5 Print(average_height) Why you use this simple method ⁉️⁉️⁉️⁉️⁉️
@madhumekala1827 Жыл бұрын
❤️
@sucharithapatnana2946 Жыл бұрын
Mam, will you be covering OOPS?? PLEASE reply mam
@avenger18983 ай бұрын
#doing_coding_exercise_average_height htlist=list(eval(input("ENTER THE HEIGHTS INTO THE LIST:"))) print(htlist) count=0 print("CALCULATING THE LENGTH:") for l in htlist: count=count+1 print(count) sum=0 for i in htlist: sum=sum+i print(sum) avg=sum/count print(round(avg)) we can do like this right ,even for input of lists once check it and give reply madam
@harshanand35584 ай бұрын
Mam I want the whole life coding with you
@Anonymous-mm3pp Жыл бұрын
Mam plz attach notes for revision ......Please 🥺
@powerupurelectricalenginee4748 Жыл бұрын
Dictionary is not completed yet why?
@koteswararaopeddiboyina2617 Жыл бұрын
58
@JESUS_FOR_EVERYTHING Жыл бұрын
present which job mam
@RaniKumari-xm9fw5 ай бұрын
Sach
@Mahesh.k.v6648 Жыл бұрын
Hii mam
@JennyslecturesCSIT Жыл бұрын
🙋🏻♀️
@make_your_mind_popup11 ай бұрын
how is able to solve these sums himself for most of the time_?
@abiramisaravanan6292 Жыл бұрын
mam pls take java🥲🥲🥲
@Thejaofficial123 Жыл бұрын
I love you madam ❤️❤️❤️
@Whatsnew197425 ай бұрын
Thala snanam chesaaru kadha
@saivamshivardan254213 күн бұрын
we can directly type cast at input function ?
@JESUS_FOR_EVERYTHING Жыл бұрын
your videos send my frnds and my wathsapp group mam
@MARUTHU_18014 ай бұрын
user_input = input("enter the height: ") new_input = user_input.split() print(new_input) for i in range(0,len(new_input) - 1): new_input[i] = int(new_input[i]) total = 0 for height in new_input: total = total+int(height) avg = total/(len(new_input)) print(avg)
@luckymudhiraj1448 Жыл бұрын
Mam one personal question please answer Mee Are you married or not
@peace346 Жыл бұрын
Married
@tiwhsjis72086 ай бұрын
Another Way: h = input("Enter heights seperated by comma(,): ") heights = h.split(',') sum=0 numbers = 0 for i in heights: sum = sum + int(i) numbers = numbers + 1 avg = round(sum/numbers) print(avg)
@suyogpardeshi58435 ай бұрын
n=input("Enter the numbers:") add=0 cnt=0 arr=[int(x) for x in n.split()] for t in arr: print(t) for cnt1 in arr: cnt=cnt+1 print("Total count is:",cnt) for num in arr: add=add+num print(add) print("Now let's find the average") avgHeight=add/cnt print(avgHeight)