Rec 1 | MIT 6.00SC Introduction to Computer Science and Programming, Spring 2011

  Рет қаралды 184,601

MIT OpenCourseWare

MIT OpenCourseWare

Күн бұрын

Recitation 1: Introduction to Coding Concepts
Instructor: Mitchell Peabody
View the complete course: ocw.mit.edu/6-00SCS11
License: Creative Commons BY-NC-SA
More information at ocw.mit.edu/terms
More courses at ocw.mit.edu

Пікірлер: 206
@IbraHimself
@IbraHimself 10 жыл бұрын
Today I learned that left handed teachers don't annoyingly block the whiteboards while writing left-to-right languages.
@metalShoesandjacket
@metalShoesandjacket 3 жыл бұрын
lefties were actually very esteemed in history, not sure why we shunned them in recent centuries.
@mufflager9065
@mufflager9065 2 жыл бұрын
Yea true always appreciated a lefty instructor
@rainzerdesu
@rainzerdesu Жыл бұрын
@@metalShoesandjacket varied perception in history. See sinister and dexter. Latin for left (sinister) and right (dexter)
@thazillah12713
@thazillah12713 9 жыл бұрын
I am pleasantly surprised that even at MIT students are reluctant to speak and answer questions that they are being asked. I was waiting for someone to eagerly answer the TA's questions. At my alma matar it was the opposite but it was also just like this at times. Great stuff and so glad MIT provides these lectures, I supplement my CS and Python studies with these videos and its so helpful. Thank you MIT, I really appreciate it.
@TheAmazingLeztits
@TheAmazingLeztits 10 жыл бұрын
I like how this guy took the original cube root code and made it so much more streamlined than the professor's code in like 10 seconds lol
@davidmisako7180
@davidmisako7180 6 жыл бұрын
Ever since I discovered the vast of information that is available in the internet and also that some world class institutes like MIT are offering quality content for free, I said never again will I ever set my foot in a classroom environment to get trained.I only need a faster internet connectivity. I am pursuing two professional certifications, one international and another local, but I benefit so much from quality lectures just like a full time MIT student. Thanks MIT ocw for empowering the world.
@fullmindstorm
@fullmindstorm Жыл бұрын
Mit teachers are the best, I get recommended these videos on electrical engineering and every time I click on them I end up watching the whole thing, the teachers make it easy to understand and follow, they are the best.
@TheL337trance
@TheL337trance 11 жыл бұрын
You are doing a great job Mitchell. I appreciate people like you.
@oblivion5683
@oblivion5683 10 жыл бұрын
i like this guy
@oblivion5683
@oblivion5683 10 жыл бұрын
he/someone on youtube with his name just +1'd this post. YES. EDIT: checked somethings, it was him. :D
@AndyFarrell07
@AndyFarrell07 12 жыл бұрын
oh and int/float = float, to save any lazy folk opening idle, not sure if he answered that
@MarzJonp
@MarzJonp 11 жыл бұрын
Thank you for clearing this up for people who might otherwise not have known that. We appreciate you taking your time out to answer our question.
@Paleoint
@Paleoint 11 жыл бұрын
I found it and am now progressing nicely through the course. Thanks again!
@PeterPinch
@PeterPinch 11 жыл бұрын
Lec = Lecture. Rec = Recitation. As the instructor said below, recitations are "intended to review and expand on the material from lecture"
@Dragoon91786
@Dragoon91786 11 жыл бұрын
...fully understand their world within the dialogs that presently harbor human thought. It is relieving to find material that will provide answers to all of those nagging theoretical and practical problems we experience and to those we wish to overcome in our day-to-day lives. Thank you professor Peabody for agreeing to have your lecture recorded. I, and I am sure others, deeply appreciate this opportunity for learning and expansion of self.
@Calupp
@Calupp 6 жыл бұрын
this guy clarified more in the 1st 5 minutes than my professors have over a 16 week period
@mizhi
@mizhi 11 жыл бұрын
The code is searching for the monthly payment that will allow you to pay the debt off in one year. There are two loops. The outer loop continues looping if the balance is greater than 0. The inner loop decrements the balance by the monthly payment until either the balance is < 0 or 12 months have passed.
@robinfr93
@robinfr93 11 жыл бұрын
This is even better than the lecture itself!! Thanx a ton mitch!! Great Stuff!!
@02arabian
@02arabian 11 жыл бұрын
i just downloaded Python 3.3.2 and i have noticed that they made the code easier to work with : 1) instead of raw_input you simply write input. 2) every print command should be put between two brackets
@matthewlevine723
@matthewlevine723 12 жыл бұрын
At 17:58, Mitch says that integer division rounded 5/2 to 2 because it simply truncated the decimal from 2.5, but this is not the case. Python and almost all other computer languages employ a default floor system. That is to say that Python prints 2 instead of 3 because 2 is closer to negative infinity than 3 is. An example that supports this can be shown by typing 5/-2 into the Python Shell. The result is -3, not -2.
@mizhi
@mizhi 12 жыл бұрын
You're correct - I goofed at that point in the recitation. The real reason for the abs(x) is that the program would give you the incorrect answer without it (for example if the user input -27, then ans is 0 and so 0*0*0 < -27 is false). The program would actually end very quickly and incorrectly return 0. What the abs(x) allows is finding the cube root of a negative integer. With some extra logic to check the sign of the input at the end, you would get the correct answer of -3. - Mitch
@PeterPinch
@PeterPinch 11 жыл бұрын
Yes, that's correct. Lectures first and then Recitations to go deeper.
@mizhi
@mizhi 11 жыл бұрын
John Guttag was the professor for the course. Each week, he gave 2 lectures where he'd introduce new material. The recitations we (the Teaching Assistants) taught were intended to review and expand on the material from lecture. Lectures typically had 100-150 students in attendance, the class size for the recitations was about 30-40 students. This enabled the students to ask questions about parts of the material with which they were struggling.
@franciscomendoza754
@franciscomendoza754 3 жыл бұрын
He is the Saitama of Computer Science lectures.
@mizhi
@mizhi 12 жыл бұрын
By the way, the topic of why integer division floors to negative infinity instead of truncates was discussed on "The History of Python" blog a couple of years ago. Search google for: "floor integer history of python" -Mitch
@peircedan
@peircedan 11 жыл бұрын
Just to answer the questions from Harlequin619 they don't normally create "alternate versions". What usually happens is the language gets updates that are usually improvements that don't break previous versions. In the case of Python there has been a major update with Python three. Packages created to work with versions 2.x don't work with version three. Some new updates have been added to version 2.7.x that don't break old code so now there is a fork. Eventually 2.x will be dropped.
@marawanish
@marawanish 11 жыл бұрын
Thanks Mitch..Awesome effort....
@linbiao6558
@linbiao6558 9 жыл бұрын
Thank you very much!
@mizhi
@mizhi 10 жыл бұрын
The core value of the course would be the basics of programming in general. Although the language used is specifically 2.X, the fundamentals of abstraction, decomposition, functions, variables, etc apply pretty universally across languages. Think of Python 2.X as the concrete expression of an idea of solving a problem in a computationally tractable way. That said, I do believe we started focusing less on Python particulars around recitation five or six.
@mizhi
@mizhi 11 жыл бұрын
If the balance is positive at the end of the inner loop, the monthly payment wasn't enough. In this case, the outer loop condition is true, so the balance is reset and the monthly payment increased by 10. The inner loop runs again. This continues until 12 months of the monthly payment brings the debt balance to 0.
@maximflorov3232
@maximflorov3232 7 жыл бұрын
Top speaker!
@mizhi
@mizhi 12 жыл бұрын
Andy, the reason is that input() takes a string as an argument that it interprets as a piece of python code. raw_input() returns whatever is input without any interpretation. input() can handle strings, but they have to be quoted i.e. you'd enter: "a string" *with* quotation marks. If you enter it without the quotes, python attempts to interpret it as a variable name. Note: python 3.X redefined input to function like raw_input from pyton
@mizhi
@mizhi 12 жыл бұрын
3.x.x has been out for years now. A lot of what's holding adoption back are third party modules that are in wide use. For example, one of the main reasons we stuck with 2.x.x in 6.00 was because matplotlib and numpy had no 3.x.x versions available at the time. Even now, numpy seems to have support for 3.x only on Windows. Many (most?) of our students are using Macs and we had to pick the python version that gave us as broad coverage as possible. - Mitch
@JJJ111JJJ
@JJJ111JJJ 5 жыл бұрын
I'm neither a student nor do I work in IT, but these videos are still very fun and interesting.
@williambatie8179
@williambatie8179 11 жыл бұрын
Select Run from the IDLE Menu Bar, and then select Run Module. If you do not see Run on the Menu Bar then your at the wrong window. Highlighting the code has nothing to due with running it. Highlighting was done only for showing what he was talking about. If you do not have the window then you need to select New, Open, or Open Recent from the IDLE Menu Bar. Your code goes in the resulting window. As long as the window is active the IDLE Menu Bar will have Run instead of Shell.
@JunaidSalehHayat
@JunaidSalehHayat 8 жыл бұрын
Thanks a lot for sharing!!
@edmbootcamp6188
@edmbootcamp6188 2 жыл бұрын
I don't know why.... but I trust this man
@esenaya
@esenaya 11 жыл бұрын
HI Mich, thanks so much for this brilliant video tutorials. I am now taking my first course in programming and I hope to get more help from you. Please help with below explanation of the code: Why did you change i from type int to s (type str)? what is the essence of s = ' ' ? I expected to see something like " if i % 3 ==0 and i % 5 == 0: to computer for the FIzzBuzz but rather I saw something else--what is the trick?
@millennia
@millennia 11 жыл бұрын
Thanks Mitch!!
@Dragoon91786
@Dragoon91786 11 жыл бұрын
If someone eventually puts all the coursework, lectures, and recitations online with videos and materials, folks like myself who are unable to attend university due to struggling finances might have a chance to, as Neil Postman and Charles Weingartner put it, "Learn to better navigate our world." Which constitutes over a lifelong process, our education. I wish to thank those instructors who have donated of their time to provide these resources to those who wish to become adept and fully...
@SimplyMyselfication
@SimplyMyselfication 11 жыл бұрын
Are recitations part of the student timetables ? I wish I had something like that during my course :(
@Paleoint
@Paleoint 10 жыл бұрын
It's right in the program. Just go to file>New Window. That opens the editor window.
@davidendara731
@davidendara731 5 жыл бұрын
THANK YOU... I am an absolute beginner and this information was sooo useful. It might be so obvious, but I just couldn't figure this out. thank you again.
@izuchukwuoruche9218
@izuchukwuoruche9218 4 жыл бұрын
Thanks😅
@michaelalvarez8937
@michaelalvarez8937 11 жыл бұрын
you can simply put x = str(input("Enter something: "))
@mizhi
@mizhi 11 жыл бұрын
(ctd) It may help to understand how I conceptualized the solution. I considered the default, non-special action, to be the printing of the integer. Printing Fizz, Buzz, and FizzBuzz are "special cases" therefore, when i is not a multiple of either number (i % 3 == 0 or i % 5 == 0), I simply print the number. If that condition is true, though, then I know that I need to do further tests to see if I should print one of those 3 strings. (ctd)
@mizhi
@mizhi 11 жыл бұрын
(ctd) Finally, s exists because if I didn't have a variable that held what I wanted to print out, then I'd have to have two separate print statements: one to output i and one to output s. It' s cleaner, in my mind, to only have the output in one location. This is a trivial program, but when you get to programs that are tens of thousands of lines of code (or larger), having someway of simplifying your code, such as keeping related code in one place, helps the process.
@Paleoint
@Paleoint 11 жыл бұрын
Hey Mitchell, nice job man! I've downloaded Python, but am having trouble with an editor. There doesn't seem to be a native or built-in one like Matlab has. Any tips? Thanks!
@ramtinassassin
@ramtinassassin 12 жыл бұрын
Thank you so much
@JerTurowetz
@JerTurowetz 7 жыл бұрын
For anyone getting in to this series using Python 3.X, int/int = int is no longer a thing as python is doing type conversion to make answers make a bit more sense (5/2=2.5). In order to request floor division you can use // instead of / as noted in www.python.org/dev/peps/pep-0238/ 5/2=2.5 5//2 = 2
@AndyFarrell07
@AndyFarrell07 12 жыл бұрын
Note the `ans` is the button beside the 1 on keyboard...not single quotation marks
@ImInTheNewsPaper
@ImInTheNewsPaper 10 жыл бұрын
Great videos! I understand everything up until the Editor Window. When the professor brought it up in lecture I was lost there as well. I have IDLE 1.2.4 up and running, but I am not sure how to bring the Editor Window up, or if I have it at all.
@kb9agt
@kb9agt 11 жыл бұрын
I used the enthought from the edX 6.00. That is 2.7.3 But if you watch the second lecture again, I believe he said Python 3.0 only has one input function. So if it's not raw_input(), the default is raw_input() so try just input()
@andressgomoso
@andressgomoso 11 жыл бұрын
Thanks you!
@mizhi
@mizhi 12 жыл бұрын
You're correct in the case of Python, so I was in error there. I made an assumption based on previous experience. However, it's erroneous to say most programming languages behave as you say. For example, a similar test using C (on a circa 2008 MacPro) results in 2 and -2, not 2 and -3. Java (JDK 6) has the same result. Perl has the same result. PHP has the same result. Emacs lisp is the same. E.g. the right side of the real result in integer division is truncated, not floored. - Mitch
@brco2003
@brco2003 10 жыл бұрын
Love the yamulke
@alekhine129
@alekhine129 3 жыл бұрын
Great content, but Python has had a few changes since then. If you fire up Python 3 you'll find that 5 / 2 will give you 2.5 (a float) now. It no longer truncates the decimal.
@JG27Korny
@JG27Korny Жыл бұрын
Indeed 2 years later
@kb9agt
@kb9agt 11 жыл бұрын
I would like to make a suggestion. The package download for the class references the official Python manuals or documentation. It could be helpful to show students where to refer to in the docs for each topic of types, variables, and the common operators such that we gain an even better understanding for interpreting these kinds of documentation. Let's start now to get used to seeing the needed improvement in all kinds of documentation. They are not tutorials but should be helpful in coding.
@CinematicChief
@CinematicChief 10 жыл бұрын
It comes when you install Python. It should be found in the same folder with the command line program, uninstall program, and documentation.
@mizhi
@mizhi 11 жыл бұрын
If you installed in Windows or Mac, you should have the IDLE program available. This has a built in editor for writing programs.
@Aydreean
@Aydreean 10 жыл бұрын
I have a question about the first While loop. The condition states that if the "abs" was taken out of the loop, the loop would run forever. However, in the case of -27, wouldn't it just not run at all because 0^3 would already be greater than -27? I'm referring to the loop at 39:40
@mizhi
@mizhi 11 жыл бұрын
I think you misheard - I said that there were no stupid questions. The intent was to help the students feel comfortable asking anything they had concerns about. - Mitch
@cgsatya
@cgsatya 11 жыл бұрын
And please tell me where should I start? This one or the John gutag one
@adiflorense1477
@adiflorense1477 3 жыл бұрын
35:41 I think the while loop is used when limits are not defined
@ImTheBatchMan
@ImTheBatchMan 12 жыл бұрын
int(raw_input("Enter a num: ")) turns your input into an integer. If you tried: input("Enter a num: ") and added it to 4, you would get an error because you are trying to add a string to an integer, which is invalid.
@aliveli-hq6zk
@aliveli-hq6zk 8 жыл бұрын
I'm referring to the loop at 39:40 if you delete "abs", the loop will be broken and program execute "x is not a perfect cube" although it is -27 and it is a perfect cube. ?????? is this MIT right?
@Harlequin619
@Harlequin619 11 жыл бұрын
Quite right. I had thought he had said Python 3.0 myself. It appears version 2.5.4 works just fine. It appears that any version of 2.0 may work just fine for this tutorial. Though, I'm curious, as to what reason do they create alternate versions of the same programming language? Do specific version work better for other tasks just as different programming languages work better for specific programming tasks?
@nodwarf
@nodwarf 11 жыл бұрын
He does show it, at 36:42
@andressgomoso
@andressgomoso 11 жыл бұрын
So you recommend first watch the Lec video of the class and then watch this? sorry if my english is not understandable.
@Dodara87
@Dodara87 8 жыл бұрын
This works but is it correctly done? for i in range(1, 101): if i % 3 == 0 and i % 5 != 0: print 'fizz' elif i % 5 == 0 and i % 3 != 0: print 'buzz' elif i % 5 == 0 and i % 3 == 0: print 'fizzbuzz' else: print i
@dignyochick
@dignyochick 12 жыл бұрын
Not sure if this answers your question but I think you're looking for the "New" window. From your Shell click "File" then click "New". Bam, you're done.
@n0us3rn4m3s4v41l4bl3
@n0us3rn4m3s4v41l4bl3 11 жыл бұрын
yes
@000093072
@000093072 10 жыл бұрын
I just feel there are many difference between the new and old version python. If I use the new version python, what would be the core value of this course for me, and which differences I should pay attention to? thanks, this's a great course. I just need to be clear how to use it.agiain, thanks for your time.
@johntokyo1
@johntokyo1 12 жыл бұрын
I see that "Mitch" replied to "AndyFarrell07" about 1 day ago. Is this the "Mitch" who is the TA in the videos for this computer science course? If yes thank you for your continued participation. I hope you can explain how I'm supposed to get my Python Shell and the other window you and the professor are using up and running and working together. I see something about PATH at the Python Wiki (mentioned in Assignment #1) but I don't understand what I'm supposed to do. I am using Windows 7.
@cgsatya
@cgsatya 11 жыл бұрын
Whats the difference between this one and the one John gutag is teaching?
@SuperFX
@SuperFX 11 жыл бұрын
he says no matter how basic your questions is that it is not a stupid question
@AndyFarrell07
@AndyFarrell07 12 жыл бұрын
No, input("Enter a num: ") can handle numbers and will assign type int or float to the variable, it cannot however handle strings, to read strings you need raw_input(), so I'm still wondering why bother with int(raw_input())...unless its something to do with user interface textboxes/etc(maybe they take strings for input) I'm new to programming, learning C in college atm, so I could be blind to something obvious, thanks for the help
@Aviose
@Aviose 11 жыл бұрын
C can do almost anything that python can... In fact, C is far more powerful overall, allowing the user more control (and giving even more responsibility of the code to the programmer). Python does allow object orientation, however, and you would have to use Objective-C or C++ to implement that with C code.
@adiflorense1477
@adiflorense1477 3 жыл бұрын
23:09 Sir, you forgot the data type called "set"
@makodad
@makodad 7 жыл бұрын
All hail the great lord Imhotep!
@benjaminmorgan7688
@benjaminmorgan7688 11 жыл бұрын
In Problem set 1 The second problem / part b. I noticed in the code you have balance = initialBalance outside of the while loop and inside? Why does it not being in both break the program and make it produce wrong results? Also how does it know how many months to pay it off in? What does it do the first month pays 10, second 20, third 30 and so on?
@alienkishorekumar
@alienkishorekumar 11 жыл бұрын
I don't think there is any problem set in the first two lectures, but i suppose they go through in the future. Just check the website.
@randomswedeinnorway8112
@randomswedeinnorway8112 11 жыл бұрын
perfect lecture for a beginner :D:D:D:D
@Maeda_Toshiie
@Maeda_Toshiie 6 жыл бұрын
Actually, for the fizz buzz, it can be made without s variable. Just print directly and suppress the default newline (which IMO, is one of the stupid default features of Python).
@asmartbajan
@asmartbajan 11 жыл бұрын
Just to add to that, if the numerator and/or denominator is a float, the result will be a float, according to my tests.
@mizhi
@mizhi 11 жыл бұрын
First, thank MIT. I'm just a bit player. :) Second, I convert i to str mainly to demonstrate type conversion. Third, s = '' simply sets s to the empty string. Fourth, no trick. It's just a different way to express the logic flow - there are many ways to skin this cat. I could have had a 3 different tests: if i % 3 == 0 and i % 5 == 0 (FizzBuzz case), elif i % 3 == 0 (Fizz case), elif i % 5 == 0 (Buzz), else print the number. (ctd)
@ImInTheNewsPaper
@ImInTheNewsPaper 10 жыл бұрын
I have the same question as John above. Is that all he has done here; just open a second window to write code in it?
@sorukai
@sorukai 11 жыл бұрын
Hey dude, you probably get hounded a lot but I have a question; problem set 1, when you need show all decimal places to .00, how do you round the currency to the nearest dollar? I could truncate the decimals, but when dealing with money, that isn't good. my answer to problem set A was off by a few cents when I just truncated everything. I don't see anything regarding rounding in the lectures.
@skysmith9412
@skysmith9412 5 жыл бұрын
I still don't understand what is the difference of operation, expression, statement, and command. Anybody can help me to get better understanding?
@wasabichips933
@wasabichips933 9 жыл бұрын
Can someone explain to me why at Rec 1 | MIT 6.00SC Introduction to Computer Science and Programming, Spring 2011 he says the program will "run for a very long time"? That implies that it would, given enough time, return the correct answer, but wouldn't it just return an error since x is starting at 0 and going up hence never becoming negative?
@mizhi
@mizhi 9 жыл бұрын
I mis-spoke while giving that answer - I don't know why. It wouldn't continue forever without the abs, it would actually exit immediately (because 0 would be greater than -27). It wouldn't give an error, but ans would be 0 because it would have never been incremented in the loop body.
@wasabichips933
@wasabichips933 9 жыл бұрын
Mitchell Peabody I see. Thanks! Wasn't expecting an answer from the instructor himself!
@mizhi
@mizhi 9 жыл бұрын
wasabichips I come back to the comments periodically to answer questions. I made a few mistakes during recitations that students would come up and ask questions about when the camera wasn't recording. Unfortunately, all my mistakes were recorded for public consumption, but not the corrections. :)
@PrintzofPeepz
@PrintzofPeepz 11 жыл бұрын
I'm having trouble in my internet and networking foundations class...could you direct me to lectures (if you know of any or there are any available) that may help me better understand these concepts please? My first two chapters are "Understanding Local Area Networking" and "Defining Networks with the OSI Model". Thanks.
@90kask
@90kask 12 жыл бұрын
I'm new to programming and just started learning Python. I'm using the newest version of Python 3, is this a mistake? Should I use python 2.x instead as it is still more widely supported, or stick with my current version?
@sunilkumarsamji8871
@sunilkumarsamji8871 5 жыл бұрын
Hi Guys, Can anyone please let me know if Recitation lectures in this course is like kind of discussion/doubt clearing/repetition of the lecture content by Prof. Guttag. I am familiar with python. Is it ok to skip recitation lectures and still be able to solve the assignments?
@johntokyo1
@johntokyo1 12 жыл бұрын
I don't understand how Mitchell (the instructor in the video) is switching between two windows. I have the Python Shell open but I don't understand the second window he is using. Also, when I copy in code from the PDF version of course notes into the Python Shell I seem unable to execute code. If I do my only manual inputs, which is tedious, I can execute. Can anyone help?
@000093072
@000093072 10 жыл бұрын
If I use the new version python, Python 3.2.3 . what should I pay more attention when I watch this online course, due to the python version difference.
@Harlequin619
@Harlequin619 11 жыл бұрын
Question: raw_input command does not work on my version of Python. I had downloaded Python 3.0 is there another version I should have downloaded instead?
@90kask
@90kask 12 жыл бұрын
How long, do you think, until 3.x.x will take over and be the more widely used version?
@brandontyler9278
@brandontyler9278 3 жыл бұрын
Can this video be useful if I'm starting to learn swift? Any similarities between python and swift?
@Primate541
@Primate541 11 жыл бұрын
raw_input has been changed in Python 3.0+ to input().
@chanjin2
@chanjin2 11 жыл бұрын
I have a quick question. I understand how the code is written but I don't understand the part where he highlights it and presses something to actually run the program. How do I do that?
@pxiao1
@pxiao1 10 жыл бұрын
are we supposed to open 2 IDLE (Python GUI) or 1 IDLE (Python GUI) and 1 Python (command line) ? I open the Python (command line) which doesnt seem to work as shown in the video, doesnt have colour, its black and I cant copy and paste I download the corrrect version but not sure if downloaded the correct format since there are so many under Windows and I dont know which to choose
@oblivion5683
@oblivion5683 9 жыл бұрын
open IDLE the gui part with the editor, then when you run the program it will open a command line for you
@katiyardak
@katiyardak 3 жыл бұрын
#optimizing FizzBuzz for i in range(1, 101): s=''; if not(i%3): s='Fizz' if not(i%5): s =s+'Buzz' else: s=str(i); print(s);
@raiynen
@raiynen 11 жыл бұрын
Soo am I insane for wanting to learn by heart the ASCII a-z A-Z in binary (and by extension hexdec)?
@zaighamabbas2041
@zaighamabbas2041 8 жыл бұрын
what is the difference between the strings in "what if the computer blows up in my face" and 'what if the computer "blows up" in my face'?
@DesertFox36
@DesertFox36 7 жыл бұрын
none. using two different kind of quotations only helps Python know that you want quotation marks inside of your string.
@AndyFarrell07
@AndyFarrell07 12 жыл бұрын
and for the output, print 'Cube root of ' + `x` + ' is ' + `ans`, works fine...with bother with str(ans), perhaps they are just showing use of functions and good programming practice, they're naming conventions could be better ^^ bad for students to fall into the habit of naming vars x y num sum ans etc, better to have iNum1 if int, or fNum1 if float etc, typeDescription style Though these are good videos, maybe they iron these things out later, I'm only on lec 4 atm :P
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 8 МЛН
TRY NOT TO LAUGH 😂
00:56
Feinxy
Рет қаралды 10 МЛН
100❤️
00:20
Nonomen ノノメン
Рет қаралды 65 МЛН
Lecture 1: Course Overview + The Shell (2020)
48:17
Missing Semester
Рет қаралды 714 М.
10. Understanding Program Efficiency, Part 1
51:26
MIT OpenCourseWare
Рет қаралды 232 М.
4. Blockchain Basics & Consensus
1:15:54
MIT OpenCourseWare
Рет қаралды 780 М.
4. Assembly Language & Computer Architecture
1:17:35
MIT OpenCourseWare
Рет қаралды 694 М.
6. Monte Carlo Simulation
50:05
MIT OpenCourseWare
Рет қаралды 2 МЛН
Lecture 6: Version Control (git) (2020)
1:25:00
Missing Semester
Рет қаралды 664 М.
Bjarne Stroustrup: C++ | Lex Fridman Podcast #48
1:47:13
Lex Fridman
Рет қаралды 1 МЛН