Python Tutorial 17: Python Functions Examples and Solutions

  Рет қаралды 15,731

Paul McWhorter

Paul McWhorter

Күн бұрын

You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
In this video we show step-by-step instructions on how to understand and use Python Functions. We write demonstration code and give examples and solutions. I do not assume you are an expert, so these lessons are designed for complete beginners.
#Python
#Lessons
#Programming

Пікірлер: 245
@pauivorra1819
@pauivorra1819 3 жыл бұрын
It is a shame the fact that you hardly get views, likes and comments. Your effort in this series really deserves more
@Leonarco333
@Leonarco333 2 жыл бұрын
I agree. These courses are better than some of the college classes I’ve taken and those classes cost hundreds to thousands of dollars. I really wish I was in a position to help financially, but the best I can do is tell everyone I know. Python and Arduino are absolutely essential to modern engineering and these classes are accessible to everyone. Paul could change the world if people were interested in learning. I’m so grateful that I found these classes.
@gabrielsoroka8749
@gabrielsoroka8749 3 жыл бұрын
I love how much he has upgraded over the years if you check his old videos. Amazing progress and great videos. Keep it up Mr McWhorter.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Thanks a ton!
@hughpatterson1480
@hughpatterson1480 2 жыл бұрын
I figured this one out. Funny story: I am taking a post grad class in Python programming for self driving cars. We were given an assignment and everyone turned in this complicated coding which they got wrong. I managed to get it right because it was the problem was similar to one of your homework assignments that I had done. The point is that the lessons you are giving teach coding that is used in very complicated projects involving Python. I will be having my students go through your entire series. Thanks for another great lesson Paul!
@mkotalik5915
@mkotalik5915 2 жыл бұрын
Finally! I have found the best "Introduction to Python" series on KZbin! God is Good! Thanks Paul
@amayaphotos8016
@amayaphotos8016 Жыл бұрын
I AM A LEGEND. Got it correctly. Loved this assignment. Thanks Paul
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@alanjones56
@alanjones56 3 жыл бұрын
Thoroughly enjoying this set of tutorials. Keep it up Paul. Very inspirational!
@ondraskala1233
@ondraskala1233 3 жыл бұрын
I am a legend! This project was one of the easiest yet, thanks a lot for these amazing tutorials :)
@danstachelski9185
@danstachelski9185 3 жыл бұрын
Got this one, finally. Proud to say - I am Legend. Excellent series! Keep up the good work.
@benthompson6118
@benthompson6118 Жыл бұрын
I am legend. Great lesson and like others I had to watch your video a few times and work through things until I got it down. It all makes sense now! Thank you Paul!
@visionaryrobotics4065
@visionaryrobotics4065 2 жыл бұрын
I spent a good amount of time with this homework, I did learn a lot more about the functions but I did do the homework partway. Love the videos!!
@alisheheryar1770
@alisheheryar1770 3 жыл бұрын
Hello dear sir, I am an Machine learning Engineer now and i started this journey back in 2017 with your arduino tutorials. Its been an awesome ride. Thank you for you content and understanding. Respect.Stay blessed and keep imparting knowledge.
@chalmerditmars7037
@chalmerditmars7037 Жыл бұрын
I loved this lesson. Since I first looked at Python I have been trying to figure out the flow. I have found no one else on the net that explains this in layman's terms. It is like building a house and you send material out to a cabinet shop and cabinets come back built. To make matters worse you call it boards and he calls it birch so unless you look for the transport order you do not know where progress went to. I got so excited I did print, average, high, low, sort descending, and sort ascending. Thank You.
@m.12joel64
@m.12joel64 3 жыл бұрын
loved the assignment ! got it done first try. Thank you for all you do (I'm a LEGEND)
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Fantastic!
@daviddeegan1740
@daviddeegan1740 4 ай бұрын
Actually did this ! Can't believe it , I struggled a bit but took my time and wrote it out in pseudo code first, looking forward to learning about classes
@igortomic1525
@igortomic1525 2 жыл бұрын
The best free tutorials !!
@lakshmadaan8871
@lakshmadaan8871 2 жыл бұрын
Thank you Paul for bringing my love for coding back......I was haviing some error doing it last night then today morning I went through the program again and saw that i had defined tot=0 within the for loop that's why total and average function were not working. took it outside the for loop and it worked like a boss😊🎉
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Great job!
@hoggboss4204
@hoggboss4204 2 жыл бұрын
i am legend! i think the way you explained functions as 'throwing' a value to a function that 'catches' it and 'throws' it back once it does what you told it to really helped. I think the program looks much neater this way, I can't wait to apply functions to my own projects
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Glad it helped!
@andylaurie326
@andylaurie326 3 жыл бұрын
I am LEGEND. Took awhile but got all the functions done and called in order. Now I want to make a menu to just call the function I need.
@petefontana1958
@petefontana1958 2 жыл бұрын
I am legend. As always your homework is never as simple as you make it sound. Thanks for making me use my brain.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
LEGEND!
@berryblades
@berryblades Жыл бұрын
I AM LEGEND! Added the sorting function too! Another great video Paul, if I ever get a well paying job I am upping my patreon contribution, you are solid gold sir!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Legend!
@maxfrischdev
@maxfrischdev 2 жыл бұрын
Honestly, it looks like most of the fancy KZbinrs with their sayings and jingles actually copied from YOU! 😆 That is ment as a compliment. Very good entertainment and motivation while secretly injecting skillz and wisdom in our brains! Much appreciated, Paul!
@soufianeerrami2507
@soufianeerrami2507 2 жыл бұрын
I'm a legend 😎 Thank u Mr Paul. For the high and low function, I create a function using the max() and min() functions instead of the for loop.
@soundarrajankannan7692
@soundarrajankannan7692 3 жыл бұрын
Thank you for all your videos. I learning from all your videos. As you said, you are not leaving anyone behind. I did my homework(I am legend).
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Great job!
@steveholt8991
@steveholt8991 20 күн бұрын
Homework done. Getting to the tricky bits now but it's exciting to learn every lesson.
@kevinmeeker6548
@kevinmeeker6548 Жыл бұрын
I am LEGEND! I am really enjoying this series. Thank you, thank you!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad to hear it!
@0Mr.Java0
@0Mr.Java0 Жыл бұрын
I am legend. Another Great lesson! I must be learning something if I am able to do the homework.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@aungphyokyaw4475
@aungphyokyaw4475 Ай бұрын
I am a legend. So happy that I am able to do the homework assignment. Love you my coach, Paul.😃🥰
@paulmcwhorter
@paulmcwhorter Ай бұрын
LEGEND!
@clutchgamermoments
@clutchgamermoments 8 ай бұрын
I AM LEGEND!!! God bless you man, keep up the great content I am learning so much from binging your videos.
@paulmcwhorter
@paulmcwhorter 8 ай бұрын
LEGEND!
@clutchgamermoments
@clutchgamermoments 8 ай бұрын
@@paulmcwhorter Hi Paul
@hamishgrant2802
@hamishgrant2802 2 жыл бұрын
My goal for the next month or so is to build a program that will automatically install programs from a usb drive onto my computer. These tutorials are really helping to freshen up my python skills before I delve into my project. Thanks Paul.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Sounds great!
@martinlewis645
@martinlewis645 2 жыл бұрын
Thanks Paul. Another great lesson. Legend, No camping furniture here.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Boom!
@ecassar1975
@ecassar1975 2 жыл бұрын
I'm a legend. My homework is almost identical to your program. I can't believe that I am managing to code in python. You are such a great teacher. Thanks a lot for your lessons. You are amazing.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
That is awesome!
@suramyadidwania623
@suramyadidwania623 2 жыл бұрын
I did the homework in a different way using the defined function tally(x) which is number of my grades and all the calculations were under this function and then I returned 4 variables and this code only took 23 lines so I found that easier but anyways thank you for the solution, you are my huckleberry. I very much appreciate it, love your videos. 👍
@YJWJESS
@YJWJESS 3 жыл бұрын
Thanks Paul. I am Legend. :) I really really like your series. Arduino lessons were very helpful. Please keep upload videos. I need your wisdom :) I'm sharing your videos to my friends.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Thanks, will do!
@suganyamuthuraman419
@suganyamuthuraman419 3 жыл бұрын
once again a very good lesson , and I almost forgot-- I AM A LEGEND
@davidbuckley4912
@davidbuckley4912 Жыл бұрын
I am LEGEND. Another great tutorial. Thank you Paul
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@TyroneJester
@TyroneJester 3 жыл бұрын
i am legend, took me a while but loved every min of it
@davidschnider1297
@davidschnider1297 Жыл бұрын
Hi Paul... I am legend... yes.. i sure can relate to your closing comments re Classes and Methods... saw them for the 1st time in Lesson 33 on RPi Programming... ( that is why I am back here :-) ) it sure was like a JIG SAW PUZZLE... looking forward to learning and solving the mystery around Classes and Methods,.. Blessing to you...
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Legend!
@Ammaray
@Ammaray 2 жыл бұрын
I AM LEGEND - Thank you for your "most excellent" Python tutorial series - very much appreciated! I will continue to recommend your videos to others. I look forward to more videos from your channel. Any plans to cover data structures with Python?
@ricklawitzky8311
@ricklawitzky8311 2 жыл бұрын
I AM LEGEND. Learned so much again. Thank you.
@kevinadesso825
@kevinadesso825 7 күн бұрын
it was blood and tears BUT I AM LEGEND, I always be grateful to you, I started studyin for electronic engineer degree hope to go throuh all, and in mean time THANK YOU, YOU are a LEEEEGEND
@paulmcwhorter
@paulmcwhorter 7 күн бұрын
LEGEND!
@legend1204
@legend1204 2 жыл бұрын
You are a LEGEND!
@jimsimpson1006
@jimsimpson1006 7 ай бұрын
Got this one. I’m just waiting to see how well my solution corresponds to Paul’s. ………… A couple of minor differences but functionally identical, giving the same output. 😊
@mateobertin3376
@mateobertin3376 2 жыл бұрын
I folded up like a ch... I AM LEGEND. Thanks paul for your incredible tutorials. Greetings from Argentina🇦🇷
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Nice work!
@charlotteswift
@charlotteswift 3 жыл бұрын
Really enjoying the lessons. Thank you.😺 I am Spartacus.
@okwangstephen1373
@okwangstephen1373 Жыл бұрын
i am a legend. it took me long but finally i managed. thank you so much
@syedasadaf1194
@syedasadaf1194 3 жыл бұрын
You are right when you do it, it looks easy but when I try to do,it takes a lot of time
@Andre-dn7dk
@Andre-dn7dk 2 жыл бұрын
THANK YOU FOR THE CONTENT!
@mikekeller7342
@mikekeller7342 3 жыл бұрын
I am legend!!! GREAT homework assignment. Bring on OOP!!!!
@zoltantakacs3812
@zoltantakacs3812 Жыл бұрын
Thanks for the lessons and your motivation to teach. I am legend...at least on this one.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@Mouse_007
@Mouse_007 3 жыл бұрын
I am Legend. Thank you Paul that was fun and easier because of the separate functions.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Excellent!
@ModernDayWanderlust
@ModernDayWanderlust 2 жыл бұрын
I had to watch through your previous video a couple times to really wrap my mind around exactly how functions are functioning (a couple rounds of espresso jet fuel helped, obvi) but I got there in the end! I still need a bunch of practice on this one, if I'm not paying attention I lose track of variable names and end up vaguely lawn-chair -esque, but commenting everything out helps.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Yes, if you ever get confused with these lessons, 1) Pour a stonger cup of coffee, and 2) turn the volume up second time around. That almost always works.
@ModernDayWanderlust
@ModernDayWanderlust 2 жыл бұрын
@@paulmcwhorter I'm just happy that learning to code has totally justified my home espresso setup!
@Godsbeloved05
@Godsbeloved05 2 жыл бұрын
I am legend...I am so grateful about your videos. Can we be taught machine learning for everyone? I would love to see that
@danielduplessis7221
@danielduplessis7221 2 жыл бұрын
I Had to Review Lesson 16 Three Times, I Am Legend!!
@typicalcookies8123
@typicalcookies8123 Жыл бұрын
I AM LEGEND, thankyou so much for your videos! I even put a sorting function in there to print the numbers highest to lowest, I had to write it out on paper first though 😅
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@TheScissorunner
@TheScissorunner 2 жыл бұрын
Hold my breath when I hit run? Sure do, but I no longer turn blue and feel like I'll pass out before I get my code to run. Getting better at this thanks to Mr. McWhorter!!!!!
@boydrogers7227
@boydrogers7227 3 жыл бұрын
Python+Arduino=Capability Overload. Color me stoked!
@brettkennedy4266
@brettkennedy4266 3 жыл бұрын
I folded up the entire store numerous times before relenting and working through the solution. I'm LLLEEEAAARRRNING
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
There is no learning without some level of pain.
@stephanvb5561
@stephanvb5561 3 жыл бұрын
Thanks for the Lesson. The return and where it gets catched is still confusing me sometimes. have to practice and repeat this more often
@colepdx187
@colepdx187 2 жыл бұрын
Piece of pie. Easy as cake. I am legend. added handling of exception if a string is entered. added accepts grades until a blank is entered. added decimal alignment in output.
@maku5289
@maku5289 Жыл бұрын
6-days-in-a-row 💥 (no coffee because it's really late) Hope to keep this up for weeks 🦾. Thanks as always.
@larryplatzek9017
@larryplatzek9017 3 жыл бұрын
Ready for Tutorial! Hope Everyone has Their Coffe fix Ready!
@dzeykop
@dzeykop Жыл бұрын
Thank you Sir, another great lesson! Your lessons are not wasted time (#NWT) for me! 👍
@paulmcwhorter
@paulmcwhorter Жыл бұрын
My pleasure!
@mecatronicsforeveryone9565
@mecatronicsforeveryone9565 3 жыл бұрын
👍 thank you
@dashakarataj6047
@dashakarataj6047 Жыл бұрын
I'm a legend , Hats off sir
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@terrymurphy565
@terrymurphy565 2 жыл бұрын
I am Legend - I am really enjoying these python lessons. Will we be learning how to output our program to some kind of user interface instead of just the Terminal.
@kck.Schrodinger13
@kck.Schrodinger13 2 жыл бұрын
I AM LEGEND. You are seriously underrated..
@drorlivneh4499
@drorlivneh4499 2 жыл бұрын
Really having fun
@markjosephcruz8834
@markjosephcruz8834 2 жыл бұрын
I am legend. Thanks for lessons
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
LEGEND!
@danielsaenz5570
@danielsaenz5570 2 жыл бұрын
I AM A LLLL... lawn chair :( sadly but after watching this video it made a lot of sense!!! Thanks for the greatest tutorials!!!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
You can do it!
@darklightining6412
@darklightining6412 Жыл бұрын
I am al legend, can''t thank you enough, sir.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@eeshaangupta9120
@eeshaangupta9120 3 жыл бұрын
sir I have a question related to robotics sir, I founded that arduino isn't perfect for robots because it cannot convert text to speech *simply*. so, sir the industries who make robots, what they use as the brain of their robots?? like boston dynamics and etc......
@bassman2162
@bassman2162 2 жыл бұрын
I have found that I have to jump through major hoops to get a print out of my code. Is there an easier way than saving the the code in a .txt file and printing that? It loses its formatting and color. Also is there a way to get the output results to printer. So far I’ve just used copy and paste to paste a sample below my code and put the # line comment on it
@RobVollmar
@RobVollmar 2 жыл бұрын
I'm really enjoying the series. Is it your intention for students of this class to progress through the “Learn Python for Beginners” playlist into the 3D Graphics and AI for Everyone lessons as presented in the playlist?
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Yes.
@roasted_guava5706
@roasted_guava5706 3 жыл бұрын
Will you do user interface design tutorial mr?
@tntragan
@tntragan Жыл бұрын
I am legend (this time). I had to go back and watch the video again to get it figured out.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@edgarpanunciolobitana4217
@edgarpanunciolobitana4217 2 жыл бұрын
greetings, Sir Paul, I have a question I have undefined Variables highG and lowG, how do I get rid of these
@pateekdarnal2256
@pateekdarnal2256 3 жыл бұрын
I AM LEGEND sir, thankyou very much
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Most welcome
@tiberiumihaescu5382
@tiberiumihaescu5382 2 жыл бұрын
I am Legend! Thank you for everything you're doing! I have a question: Is it better to follow the Python lessons as they are saved in the Python playlist? Or should I do each tutorial (Python tutorial, 3D, AI for Everyone) separately?
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Either way, which ever you prefer.
@tiberiumihaescu5382
@tiberiumihaescu5382 2 жыл бұрын
@@paulmcwhorter sure thing, thank you!
@pokerface68
@pokerface68 2 жыл бұрын
I am Legend! I did get the basic homework done but I am struggling with a sort function. It sorts the grades fine, but I want to keep a copy of the original grade order also, which I am having trouble with. I created a copy of the original array and sorted it in my function, but the original gets sorted too... I WILL figure it out :)
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Topeka, try the following from the python shell, or just look at my results below: >>> x=[1,2,3,4] >>> y=x >>> y [1, 2, 3, 4] >>> x[0]=17 >>> x [17, 2, 3, 4] >>> y [17, 2, 3, 4] Do you see when you say y=x, it does not really make a copy of x? It just gives x two names. x and y both point to the same array. To really make a copy you have to do this: >>> y=x.copy() >>> x[0]=55 >>> x [55, 2, 3, 4] >>> y [17, 2, 3, 4] Really a tough problem. Thanks for asking, hope this helps.
@pokerface68
@pokerface68 2 жыл бұрын
@@paulmcwhorter DANG! you make it so easy - that was a wonderful explanation! I tried it in the shell like you recommended and saw exactly what you said, that y was pointing to the same array. Then I tried .copy() in the shell and saw how I now had an x array and a y array that were the same except for the element [55] that I changed. It all made perfect sense, and when I went back to my Visual Studio Code and made a copy of my array using .copy() it worked like a champ, just as I was trying to accomplish! Thank you so much, haha I was just going to bed when I saw the notification that you had responded to my comment and I had to turn right around and try it. Now I can go to bed knowing you helped me solve my problem, but I am so excited I may not be able to fall asleep! I was semi-legend before, but now I am LEGEND!
@bassman2162
@bassman2162 2 жыл бұрын
I found a problem that I don’t understand. If you code: numGrades=int(input(‘Enter Number of Grades: ‘)) Then enter a float by accident the code will crash. I have changed my code to : numGrades=int(float(‘Enter Number of Grades: ‘))) You have been saying int() will convert a string to integer, but it only seems to if your string looks like an integer. int(float()) will give an integer if your string looks like an integer or a float. I’m sure the program would crash if an alpha character were input. So to prevent crash does the code have to input a string with no conversion to float or int. Then check the input value to make sure it isn’t alpha or special characters, then if not convert to float and then to int? Is there a better way? Also is there a better to send a question like this like email? Thanks for your help.
@Leonarco333
@Leonarco333 2 жыл бұрын
Coming to python from matlab My main program is A=getGrades() ave=aveGrades(A) a,b=highLow(A) printResults(A,a,b,ave) Works perfectly.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Works perfectly, yet you really have not learned anything. The whole point of the lesson was to think through arrays and functions, and learn to WRITE FUNCTIONS, not use other people's function. If you dont think through these classic engineering problems on your own, what will you do when you come to a problem without a canned solution.
@Leonarco333
@Leonarco333 2 жыл бұрын
@@paulmcwhorter oh I was just commenting on how simple my main code was. All data entry and all calculations and manipulations were done in the four functions I wrote above it. Even all of the print formatting was done with subroutines. It took me back to my matlab class where our main programs were not allowed to do anything but call subroutines for full marks.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
I know. It is one of the reasons why I hate matlab, and hate the way 'coding' is taught in most colleges. Lets first teach how to think. How to plan, and develop a problem solving strategy, then how to implement our strategy in code. Too much of todays teaching is just calling subroutines written by other people.
@Leonarco333
@Leonarco333 2 жыл бұрын
@@paulmcwhorter I had a pretty good professor back then. We had to write all of our own functions. I wrote all of the functions for this project, too. The workflow just took me back in time a little bit.
@bassman2162
@bassman2162 2 жыл бұрын
I got it to work. The biggest problem I had was troubleshooting code where the mistake was a misspelling of a name like gradesAvg when it should have gradeAvg. Or leaving a comma out of the syntax.
@bassman2162
@bassman2162 2 жыл бұрын
Con
@railcat7083
@railcat7083 3 жыл бұрын
Legendary on....
@jonathanlanders9406
@jonathanlanders9406 Жыл бұрын
I AM LEGEND! I love functions when using Arduino. Especially when using dc motors.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@jabber2824
@jabber2824 Ай бұрын
I am legend. what's the reason for the functions to be at the top? is it because python is an interpreted language and not compiled like c++ used for Arduino IDE? great lesson again, thanks
@vanshdhelia4042
@vanshdhelia4042 Жыл бұрын
I am a legend!!!
@lil_muna
@lil_muna 3 жыл бұрын
IAM LEGEND!!
@kirubeltekle9553
@kirubeltekle9553 Жыл бұрын
I love your videos my hucklebeery
@sailingskismo
@sailingskismo 6 ай бұрын
Slightly different looking code but only because I wanted to format the outputs to the terminal a little bit more detailed. However, I did do it without looking at Pauls. But I did need the internet for some syntaxing help. If anyone has the inclination to read the code without falling asleep I'd be curious to know if it can be done more streamlined? :) #This FIRST FUNCTION asks for grades * def inputGrades(gradeQty): for q in range(1,gradeQty+1): result=int(input('What was the grade for exam number '+str(q)+ '? ')) print() results.append(result) return results # End of FIRST FUNCTION * #This 2ND FUNCTION prints the results in the array [results] * * def printGrades(): for q in range(1,gradeQty+1): print('For exam number', q, 'your result was ', results[q-1]) print() #This is the end of the 2ND FUNCTION * * #This is the 3RD FUNCTION * * * def aveGrades(): average=float(sum(results)/gradeQty) print('Your average score was ', average) print() #This is the END OF FUNCTION 3 * * * #This is function 4 to sort highest to lowest grades * * * * def highLow(): for run in range(0,gradeQty-1,1): for test in range(0,gradeQty-1,1): if results[test]
@scrappybobbarker5224
@scrappybobbarker5224 2 жыл бұрын
From lessons 1 through 15, I was legend, yet I am not legend this time.
@nerdygeek8947
@nerdygeek8947 3 жыл бұрын
Mr Paul can u please make a coffee making tut and strong tea or chai is also awesome with programming
@senpaizoro2592
@senpaizoro2592 Жыл бұрын
I am a Legend!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@user-ng6to7wq9h
@user-ng6to7wq9h 3 ай бұрын
I have corrected my short-comings,by watching half of this video def tally(h): G=[] for l in range(0,h,1): gr=float(input("Please enter the student‘s grade: ")) G.append(gr) return G,h def Allgrades(h,x): print("Your grades are: ") for i in range(0,h,1): print(x[i]) def Avg(h,x): tot=0 for l in range(0,h,1): tot=tot+x[l] m=tot/h return m def Low(h,x): lowest=100 for l in range(0,h,1): if x[l]t: t=(x[l]) return t Totstud=int(input("How many students do you have? ")) totalstudents=tally(Totstud) print("You have a total number of",totalstudents[1],"students.") Listedgrades=Allgrades(Totstud,(totalstudents[0])) t=totalstudents[0] k=Totstud Averagegrade=Avg(k,t) print("The average grade of your students is",Averagegrade) cd=totalstudents[0] numnum=Totstud Lowey=Low(numnum,totalstudents[0]) print("Your highest grade is",Lowey) p=totalstudents[0] numnum=Totstud Highey=high(numnum,totalstudents[0]) print("Your highest grade is",Highey)
@wendygrant2735
@wendygrant2735 2 жыл бұрын
I got stuck on 'print=printGrads(inputGrades,numGrades)' with printGrads the function to print. When I wrote the average function I got TypeError: 'NoneType' object is not callable. Of course this was because I used the word print in 'print=printGrads'. Been searching for the mistake quite a while. But that's part of the fun of course.
@aksh_singhal6779
@aksh_singhal6779 3 жыл бұрын
Hi Sir . I want to become IOT specialist ,What are things to learn?
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Keep watching these lessons!
@ellerycadel
@ellerycadel Жыл бұрын
I am legend but wow! that was a tough one for me!!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@codecage9333
@codecage9333 3 жыл бұрын
I am legend! But I might have been dinged a little by Paul since I didn't round my fractional average grade.
@yusufguler1662
@yusufguler1662 3 жыл бұрын
I am Legend!
@86Carrera911
@86Carrera911 2 жыл бұрын
I am legend!
Python Tutorial 18: Understanding Python Methods and Classes
42:43
Paul McWhorter
Рет қаралды 24 М.
Advanced C: The UB and optimizations that trick good programmers.
1:12:34
Eskil Steenberg
Рет қаралды 164 М.
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 67 МЛН
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 38 МЛН
Python Tutorial 16: Understanding Python Functions
34:26
Paul McWhorter
Рет қаралды 24 М.
Python Hash Sets Explained & Demonstrated - Computerphile
18:39
Computerphile
Рет қаралды 113 М.
Python Tutorial 19: Python Classes and Methods Homework Examples
57:57
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 798 М.
CUDA Simply Explained - GPU vs CPU Parallel Computing for Beginners
19:11
Python Simplified
Рет қаралды 247 М.
2000 HOUR 2D Game Engine! // Code Review
32:01
The Cherno
Рет қаралды 83 М.
How do computers read code?
12:01
Frame of Essence
Рет қаралды 3,1 МЛН
Titus Reacts to Linus Tech Tips Linux Daily Drive Challenge
20:21
Chris Titus Tech
Рет қаралды 737 М.
Мой новый мега монитор!🤯
1:00
Корнеич
Рет қаралды 600 М.
8 Товаров с Алиэкспресс, о которых ты мог и не знать!
49:47
РасПаковка ДваПаковка
Рет қаралды 178 М.