Coding Exercise for Beginners in Python |Exercise 14 | Python Tutorials for Beginners

  Рет қаралды 63,034

Jenny's Lectures CS IT

Jenny's Lectures CS IT

Күн бұрын

Пікірлер: 107
@seenumadhavan4451
@seenumadhavan4451 Жыл бұрын
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-hat666
@white-hat666 4 ай бұрын
total wrong
@sayyedirshad9941
@sayyedirshad9941 3 ай бұрын
​@@white-hat666It is giving the correct output.. then how it is wrong
@Fullstackdeveloper13
@Fullstackdeveloper13 8 ай бұрын
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😉😉
@PushpendraSinghDangi
@PushpendraSinghDangi 11 ай бұрын
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))
@jjjmemes420
@jjjmemes420 7 ай бұрын
Yes, i also did the same
@sumanthsathala1790
@sumanthsathala1790 5 ай бұрын
but when we add float values it rerturns error
@abebebiru1701
@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!
@cbidcpbhargavips4901
@cbidcpbhargavips4901 14 күн бұрын
lis = list(map(int, input("Enter the Elements: ").split())) sum = 0 for i in lis: sum += i length = len(lis) print(sum/length)
@AmanMomin-sj7sd
@AmanMomin-sj7sd 6 ай бұрын
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
@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
@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
@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)
@midnightphantom4787
@midnightphantom4787 5 ай бұрын
Hey I did this too
@venkateswarlugoud4564
@venkateswarlugoud4564 Жыл бұрын
Excellent explanation mam even who don't know about coding they can also easily understand your lectures🎉🎉❤❤😊
@prakhargupta7687
@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))
@umairmughal7892
@umairmughal7892 6 ай бұрын
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.108
@Harsha.108 4 ай бұрын
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
@decentboys1351 Жыл бұрын
Great explanation by great teacher🎉🎉😅
@notkrish9405
@notkrish9405 2 ай бұрын
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
@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
@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
@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
@itsmylife4048 Ай бұрын
As per the instructions here, you cannot use len() function...
@deekshithaparasu
@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))
@makupetrical003
@makupetrical003 7 ай бұрын
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
@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
@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}")
@ruxhant4907
@ruxhant4907 2 ай бұрын
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
@itsmylife4048 Ай бұрын
Hello Ma'am, one of the terms I have learned from you is "Dry run" 😃
@dsc40sundar18
@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
@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-f3q
@VISHNUMURALY-f3q 10 ай бұрын
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
@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
@venkateswarlugoud4564 Жыл бұрын
I am watching your python series since morning I love your videos❤❤❤
@vigneshk5193
@vigneshk5193 Жыл бұрын
Excellent explanation mam. Keep continuing this course
@MaDmAxLoCaL
@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
@akarahjonathan2227 Жыл бұрын
your lesson is. V ery easy to unstand
@fitoremorina2894
@fitoremorina2894 Жыл бұрын
Thank you for your videos Jenny! Your videos are very helpful! Go on!☘
@karthikeyasarma283
@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")
@gurukiran4476
@gurukiran4476 29 күн бұрын
thanks for everything ma'am 🤩
@learncode5798
@learncode5798 Жыл бұрын
Thank YOU Mam...!!!🙂
@adupaharshith7564
@adupaharshith7564 10 ай бұрын
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
@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
@manfredmasiko4444 Жыл бұрын
Superb 👍👍
@mjmr-official-
@mjmr-official- Жыл бұрын
Excellent
@sandhyatoleti5288
@sandhyatoleti5288 6 ай бұрын
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-ww8oi
@ganeshganesh-ww8oi 4 ай бұрын
You are a great
@KEVIN11-ty1go
@KEVIN11-ty1go Жыл бұрын
I love your videos ❣️ And way of teaching 😊
@sumayyakhan2004
@sumayyakhan2004 Жыл бұрын
I was watching your videos since 3 hrs now. Cuz I've my externals from 17th. 😭😭
@JennyslecturesCSIT
@JennyslecturesCSIT Жыл бұрын
Good luck 👍
@mr_affan15
@mr_affan15 Жыл бұрын
Then why u express 😭 this emoji 😅
@SudhakarRaja-y4n
@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
@systembreaker4864 Жыл бұрын
Shortest solution 🎉🎉🎉
@MyCodingDiary
@MyCodingDiary Жыл бұрын
Your content is amazing, I just subscribed!
@sanataniladka1083
@sanataniladka1083 Жыл бұрын
Love from bihar❤
@DilshadAdk
@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
@MyCodingDiary Жыл бұрын
You're killing it with your content, just subscribed to support you!
@tamilselvan.s0394
@tamilselvan.s0394 Жыл бұрын
What about using FLOOR DIVISION for round of values😅
@vigneshsankar4922
@vigneshsankar4922 Жыл бұрын
U r my lovely cute tutor🎉 Lote of love from great TaMiLnaDU.
@moscow_naresh_putin
@moscow_naresh_putin 7 ай бұрын
its not great
@thulasiramnaik7294
@thulasiramnaik7294 Жыл бұрын
nice🤗
@LawalHammedTunde
@LawalHammedTunde 2 ай бұрын
What if in a situation whereby alphabets are received from the user instead of numeric literal? This kind of exception needs to be considered.
@akkiaksahya123rd
@akkiaksahya123rd 9 ай бұрын
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
@sucharithapatnana2946 Жыл бұрын
Thank you mam
@MrSaurabh
@MrSaurabh Жыл бұрын
@SAMEENASHAIK-el6yr
@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
@MyCodingDiary Жыл бұрын
Your videos are so informative and entertaining, I just subscribed!
@JESUS_FOR_EVERYTHING
@JESUS_FOR_EVERYTHING Жыл бұрын
mam artifical intelligence some videos cheyandi
@johngkitvsr170
@johngkitvsr170 Жыл бұрын
Unexpected time the video is coming love you mam 😉❤
@JennyslecturesCSIT
@JennyslecturesCSIT Жыл бұрын
Well I like to give surprises sometimes 😁
@johngkitvsr170
@johngkitvsr170 Жыл бұрын
yeah 😂 Mam ☺️👍
@travelspurs
@travelspurs Жыл бұрын
Hyeee 😍😍😍❤️❤️ beauty 💕 though this lecture about Java is very good 🙂
@incomparablevikkie5507
@incomparablevikkie5507 10 ай бұрын
I assume if the user does not put space to all the numbers inputed, how do we takw care of that.
@sanataniladka1083
@sanataniladka1083 Жыл бұрын
First comment❤
@karthickkishor7807
@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
@madhumekala1827 Жыл бұрын
❤️
@sucharithapatnana2946
@sucharithapatnana2946 Жыл бұрын
Mam, will you be covering OOPS?? PLEASE reply mam
@avenger1898
@avenger1898 3 ай бұрын
#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
@harshanand3558
@harshanand3558 4 ай бұрын
Mam I want the whole life coding with you
@Anonymous-mm3pp
@Anonymous-mm3pp Жыл бұрын
Mam plz attach notes for revision ......Please 🥺
@powerupurelectricalenginee4748
@powerupurelectricalenginee4748 Жыл бұрын
Dictionary is not completed yet why?
@koteswararaopeddiboyina2617
@koteswararaopeddiboyina2617 Жыл бұрын
58
@JESUS_FOR_EVERYTHING
@JESUS_FOR_EVERYTHING Жыл бұрын
present which job mam
@RaniKumari-xm9fw
@RaniKumari-xm9fw 5 ай бұрын
Sach
@Mahesh.k.v6648
@Mahesh.k.v6648 Жыл бұрын
Hii mam
@JennyslecturesCSIT
@JennyslecturesCSIT Жыл бұрын
🙋🏻‍♀️
@make_your_mind_popup
@make_your_mind_popup 11 ай бұрын
how is able to solve these sums himself for most of the time_?
@abiramisaravanan6292
@abiramisaravanan6292 Жыл бұрын
mam pls take java🥲🥲🥲
@Thejaofficial123
@Thejaofficial123 Жыл бұрын
I love you madam ❤️❤️❤️
@Whatsnew19742
@Whatsnew19742 5 ай бұрын
Thala snanam chesaaru kadha
@saivamshivardan2542
@saivamshivardan2542 13 күн бұрын
we can directly type cast at input function ?
@JESUS_FOR_EVERYTHING
@JESUS_FOR_EVERYTHING Жыл бұрын
your videos send my frnds and my wathsapp group mam
@MARUTHU_1801
@MARUTHU_1801 4 ай бұрын
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
@luckymudhiraj1448 Жыл бұрын
Mam one personal question please answer Mee Are you married or not
@peace346
@peace346 Жыл бұрын
Married
@tiwhsjis7208
@tiwhsjis7208 6 ай бұрын
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)
@suyogpardeshi5843
@suyogpardeshi5843 5 ай бұрын
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)
@KEVIN11-ty1go
@KEVIN11-ty1go Жыл бұрын
I love your videos ❣️ And way of teaching 😊
@KeerthiGovindasu
@KeerthiGovindasu 7 ай бұрын
thank you maam
@glps369
@glps369 Жыл бұрын
Thank You
@yogaprakashyoga5268
@yogaprakashyoga5268 Жыл бұрын
File Handling in Python | Python Tutorials for Beginners #lec95
45:32
Jenny's Lectures CS IT
Рет қаралды 112 М.
[BEFORE vs AFTER] Incredibox Sprunki - Freaky Song
00:15
Horror Skunx 2
Рет қаралды 21 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 1,8 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 57 МЛН
While Loop in Python | Python Tutorials for Beginners #lec50
26:51
Jenny's Lectures CS IT
Рет қаралды 90 М.
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
Tuples in Python | Python Tutorials for Beginners #lec40
20:56
Jenny's Lectures CS IT
Рет қаралды 111 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 234 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 367 М.
Inheritance in Python | Python Tutorials for Beginners #lec89
27:20
Jenny's Lectures CS IT
Рет қаралды 92 М.
Types of Arguments in Python | Python Tutorials for Beginners #lec61
21:11
Jenny's Lectures CS IT
Рет қаралды 103 М.
Nested Dictionaries in Python | Python Tutorials for Beginners #lec69
22:33
Jenny's Lectures CS IT
Рет қаралды 43 М.
local and Global Scope in Python | Python Tutorials for Beginners #lec78
14:34
Jenny's Lectures CS IT
Рет қаралды 49 М.
[BEFORE vs AFTER] Incredibox Sprunki - Freaky Song
00:15
Horror Skunx 2
Рет қаралды 21 МЛН