2. Branching and Iteration

MIT 6.0001 Introduction to Computer Science and Programming in Python, Fall 2016
View the complete course: ocw.mit.edu/6-0001F16
Instructor: Dr. Ana Bell
In this lecture, Dr. Bell introduces strings and indentation in Python, then discusses basic features of programmatic logic, such as branching, conditionals, iteration, and loops.
License: Creative Commons BY-NC-SA
More information at ocw.mit.edu/terms
More courses at ocw.mit.edu

Пікірлер: 281

  • @walawave
    @walawave4 жыл бұрын

    To whoever made the subtitles for this 40+ minutes video. Thank you.

  • @juanjo984184333

    @juanjo984184333

    4 жыл бұрын

    X2

  • @30_phuc.phanvinh39

    @30_phuc.phanvinh39

    3 жыл бұрын

    X3.

  • @HKClasher

    @HKClasher

    3 жыл бұрын

    X4

  • @minhcuong4307

    @minhcuong4307

    3 жыл бұрын

    X5

  • @externalpoint861

    @externalpoint861

    3 жыл бұрын

    I think its the speech synthesizer

  • @user-fl7vs4ed6l
    @user-fl7vs4ed6l3 жыл бұрын

    pre labeling ​0:02:08​ Strings 0:03:48 (Coding) 0:06:31 Input/Output:print 0:08:21 (Coding) 0:09:57 Input/Output:(" ") ​0:12:14 (Coding) ​0:14:00​ Comparison operators on int , float , string 0:17:06 MIT map 0:18:00 0:19:58 Control flow - branching 0:20:00 0:22:00 0:24:51 ​Indentation 0:25:46 =vs== 0:28:00​ 0:28:58 Control flow : while loops 0:31:57 Control flow : while and for loops 0:35:09 ​Control flow : loops 0:36:44 range (start , stop , step)​ 0:38:00​ 0:39:42 (Coding) 0:41:06 break Statement 0:42:26 for vs while loops

  • @no1reallycaresabout2

    @no1reallycaresabout2

    2 жыл бұрын

    You the real MVP

  • @ChandravijayAgrawal

    @ChandravijayAgrawal

    2 жыл бұрын

    thanks for timestamping every video

  • @xiaochuansun2638

    @xiaochuansun2638

    9 ай бұрын

    Thank you, representative.

  • @osamakamal7171
    @osamakamal71713 жыл бұрын

    Love MIT for their CS OCW!!! One comment to add here. When you ask Python to compare two strings (like mentioned in the video "a" > "b" and the result is False) in the backend, Python is comparing their ASCII values (ASCII value of "a" = 97 and ASCII value of "b" = 98. Hence False)

  • @ChandravijayAgrawal

    @ChandravijayAgrawal

    2 жыл бұрын

    thanks

  • @r4ko276

    @r4ko276

    9 ай бұрын

    I dont know if this is entirely true, if i do "ab" == "ba". the result is false. (She said something about lexicographical)

  • @cerulity32k

    @cerulity32k

    4 ай бұрын

    ​@@r4ko276String equality checks if two strings have the same contents. Checking if a string is greater than another string (string inequality) checks if the first string comes after the second string if you were to sort them alphabetically.

  • @hemarathroy4121
    @hemarathroy41214 жыл бұрын

    I am very lucky and happy to see the smiley ,energetic and enthusiastic face of ANA mam ,when she tried to listen the question that the student asks.BUT AT OTHER PLACES , THIS HAPPENS RARELY BUT NOT IN MIT.

  • @lloydyu24
    @lloydyu247 жыл бұрын

    THANK YOU, MIT COURSEWARE and sponsors! ❤️

  • @bjr816
    @bjr8164 жыл бұрын

    Kind of wish I got to experience CS at MIT. I loved my professors but this is a professor I know I'd like and learn alot from. Plus MIT's reputation is unmatched.

  • @PeejTastic

    @PeejTastic

    Жыл бұрын

    Same, except for me it would've been math/statistics. MIT was the only school I couldn't get accepted into (it was my dream school as a high school student). Having access to this open courseware in my 30s gives me a chance to check some of it out (just in a different subject).

  • @PeejTastic
    @PeejTastic Жыл бұрын

    Me and a fellow colleague are leaping into Python (my native language being R). The lecture videos are well-paced and the lecturing style is top notch! I lecture the occasional statistical programming course, and it's not always easy to keep it interesting and engaging like it is here.

  • @DanielFerreira-gu1di
    @DanielFerreira-gu1di7 жыл бұрын

    Really good for a start with Python. Great work Dr. Bell (and Professor Grimson).

  • @unrockbaer
    @unrockbaer5 жыл бұрын

    Really liked the Zelda example, loved the flipping table :) Well played, Dr. Bell!

  • @danielkinyanjui5296
    @danielkinyanjui52963 жыл бұрын

    You're a good teacher, accessible yet giving your students a chance to learn.

  • @iam_sangu
    @iam_sangu6 жыл бұрын

    Wonderful lectures by Prof. Ana Bell. Thank you MIT OCW.

  • @DarthAbhi
    @DarthAbhi7 жыл бұрын

    Dr.Bell, can't thank you enough for the great explanation.

  • @mahiee24
    @mahiee242 жыл бұрын

    Had somebody taught flow control statements as clearly as Dr.Bell my coding journey would have been at stratospheric levels...these lecture ignited my hopes of becoming a good programmer...

  • @saimahossain332
    @saimahossain3323 жыл бұрын

    you're brilliant Dr. Bell. love your lectures💜

  • @damickillah
    @damickillah4 жыл бұрын

    OMG, these are finally in HD!

  • @nitirajdaby2554
    @nitirajdaby25542 ай бұрын

    What a smooth lecture ! Thank you ! You helped me understand Python. My professor did a terrible job teaching this. Thanks MIT !

  • @shadyhamrouny2143
    @shadyhamrouny21434 жыл бұрын

    thank you Dr Ana Bell this was a really helpful and fun course !

  • @stevemilo6935
    @stevemilo6935Ай бұрын

    This is the best MIT has to offer. Good thing its free.

  • @abhinavmathur6072
    @abhinavmathur60725 жыл бұрын

    Thank you open courseware for providing such high quality leacture and materials..hope you have a great day😊

  • @vishalmalaye
    @vishalmalaye4 жыл бұрын

    Dr. Ana Bell is great teacher.❤❤❤ You are very good at explaining and in all perspective. You are best.Thanks MIT for Dr. Ana Bell. Thanks MIT for OCW.MIT is best and doing great work.

  • @xiaoningdong1654
    @xiaoningdong16545 жыл бұрын

    She is so adorable, I really love her lessons. Thanks MIT.

  • @rinkushortsdaily
    @rinkushortsdaily14 күн бұрын

    I really love this lectures and completed my some basic python syntax and basic algorithm related concepts thanks for this contribution.

  • @premkumar-zp7gs
    @premkumar-zp7gs Жыл бұрын

    the best lecture on python, the reason why mit is a top college in the world

  • @GoutamDAS-ls1wb
    @GoutamDAS-ls1wb3 жыл бұрын

    Superb video of excellent teaching. I wish she was my professor when I was an undergrad.

  • @BackWithTheBoom
    @BackWithTheBoom4 жыл бұрын

    thank you Dr Bell ! , rock on! better explained than my school lessons 4sure

  • @oluwadaraadepoju5832
    @oluwadaraadepoju58322 жыл бұрын

    Dr Bell, you are the best❤❤

  • @diggitycat6233
    @diggitycat62333 жыл бұрын

    For those curious about how Dr. Bell commented out certain lines of code here's the shortcut list, Single line comment Ctrl + 1 Multi-line comment select the lines to be commented Ctrl + 4 Unblock Multi-line comment Ctrl + 5 P.S: Got this from Stack Overflow so due credit to the actual authors for this query.

  • @itsdejinero
    @itsdejinero3 жыл бұрын

    AMAZING LECTURE

  • @billmoran3812
    @billmoran38123 жыл бұрын

    Excellent lecture. Makes me wish I were back as a student. this is the best explanation of for & while loops I have seen. I wish I could take this course, but I no longer live in Boston.

  • @harunrashid4us
    @harunrashid4us2 жыл бұрын

    Thanking MIT OCW Please upload more 💙

  • @NANA-yh2wx
    @NANA-yh2wx4 жыл бұрын

    Dr Bell Your class was comfortable and interesting. Thank you for not writing on the board.

  • @aymensekhri2133
    @aymensekhri21334 жыл бұрын

    Thanks a lot Dr. Anna Bell

  • @hasankirca8076
    @hasankirca80764 жыл бұрын

    VERY VERY thanks ,MIT open coursewarde.

  • @simonialee1114
    @simonialee11145 жыл бұрын

    best python tutorial ever

  • @obli8984
    @obli89842 жыл бұрын

    OBLI WATCHED THIS FROM SRI LANKA.TO BE HONEST NONE OF UNIVERSITIES OF SRI LANKA PROVIDE GOOD LECTURES LIKE THESE

  • @rmurphy0001
    @rmurphy00017 жыл бұрын

    This is awesome!!!

  • @esergey12
    @esergey122 жыл бұрын

    Adorable teacher. Excellent lecture.

  • @jikachu926
    @jikachu9263 жыл бұрын

    her legend of zelda example was a really excellent example to use and keep students engaged

  • @bhanugupta4871
    @bhanugupta48714 жыл бұрын

    mam, i really loved the way you teach.

  • @denniskamonde6836
    @denniskamonde68367 жыл бұрын

    very helpful, thank you

  • @gackerman99
    @gackerman992 жыл бұрын

    you can actually use a for-loop to get input in Python - create a simple iterator class where __next__ returns a value from a call to input().

  • @jordymunozaravena3286
    @jordymunozaravena32866 жыл бұрын

    I love your problem sets. They really made me want to hit my head with a piece of wood over and over again. Real learning guys.

  • @user-kp5kg5dl8h

    @user-kp5kg5dl8h

    6 жыл бұрын

    Jordy Muñoz Aravena The ones found on the website? The ones that make you have to look up everything yourself before you can even do them?

  • @shivang581

    @shivang581

    5 жыл бұрын

    Hey! Could you please share the link of the problem sets? Thank You!

  • @ViktorMath

    @ViktorMath

    5 жыл бұрын

    @@shivang581 Here you are ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/assignments/

  • @shivang581

    @shivang581

    5 жыл бұрын

    @@ViktorMath THANK YOU SO VERY MUCH!

  • @asdaware7718
    @asdaware77186 жыл бұрын

    nice lectures delivery....dr bell

  • @akbarrauf2741
    @akbarrauf27417 жыл бұрын

    thank you ,mit

  • @techgamer1333
    @techgamer13333 жыл бұрын

    Ana Bell ❤❤

  • @snuffy5321
    @snuffy5321 Жыл бұрын

    Dr Bell is a legend

  • @cggsdtdtyfyyu9563
    @cggsdtdtyfyyu95637 жыл бұрын

    شكرا اوي

  • @thankyou_guruji
    @thankyou_guruji2 жыл бұрын

    SHE IS SUCH A GOOD TEACHER

  • @kattetivikram1862
    @kattetivikram18625 жыл бұрын

    Amazing clasess

  • @klick4x
    @klick4x5 жыл бұрын

    thank you mit

  • @trenholmelodge1820
    @trenholmelodge18202 жыл бұрын

    It would help that when Ana points to the board and makes a comment, the camera also shows the board and not the picture of Ana talking. thanks for the free lectures

  • @BC-lg1dg
    @BC-lg1dg4 жыл бұрын

    Присоединяюсь. к отзыву "walawave ", за субтитры. Thank you very much

  • @examango
    @examango4 жыл бұрын

    谢谢

  • @barlov_filange
    @barlov_filange7 ай бұрын

    The idea behind ocw is profound. By distributing knowledge to the whole world for free, MIT is paying tribute to the geniuses like faraday, curie, ramanujan etc... Who produced phenomenal works despite of not having the proper access to the knowledge they needed.

  • @dgates6165
    @dgates61652 жыл бұрын

    I love this teacher!! She's so funny, but in the driest way possible!! It's great! 😅

  • @abdullahchowdhury9589
    @abdullahchowdhury95893 жыл бұрын

    I want to ask a question not related to syllabus but a great tips Dr. Ana Bell used in this lecture, Lecture No 2(Branching and Iteration) and I have question in Time:39.48/43.30.... Here Dr. Ana used a great tips: She just select some sort of lines and deleted the "#" sign in a single moment.... I want to know how can I do it the same thing on Spyder.... Please comment to me... If you know please give me suggestion... Please Please.... (From INDIA)

  • @mikeearls126
    @mikeearls1265 жыл бұрын

    This woman is so adorably awkward, nervous and brilliant.

  • @ChandravijayAgrawal

    @ChandravijayAgrawal

    2 жыл бұрын

    not really awkward but i think this is her first lecture on this topic

  • @christianhamilton3927
    @christianhamilton39272 жыл бұрын

    Who knew Darlene would be such a good professor

  • @harshitarawat1411
    @harshitarawat14113 жыл бұрын

    Transition from if-else to while loop tells how much i took the loops for granted .

  • @ChandravijayAgrawal
    @ChandravijayAgrawal2 жыл бұрын

    She is second(I'm confused) best professor i ever got on MIT

  • @juliannevillecorrea
    @juliannevillecorrea5 жыл бұрын

    thank you !

  • @tawfeeqmuallem9086
    @tawfeeqmuallem90865 жыл бұрын

    if course_grade == A: print("this teacher is amazing") elif course_grade in range (A, C+): print("This teacher is really good!") else: if course_grade

  • @blackjack-ks8zn

    @blackjack-ks8zn

    4 жыл бұрын

    Else : If course_grade

  • @kasiviswanathboddeti9085

    @kasiviswanathboddeti9085

    3 жыл бұрын

    Syntax error For else: you shouldn't give a

  • @chaimaak9949
    @chaimaak99494 жыл бұрын

    Whene I've tried , the input part of the lecture ,,, The following message just showed up ( get ipython ().kernel.shell.run_line_magic('clear', ") Can anyone please help me !!!!! Otherwise, the lectures are perfect and Very well explained.

  • @ashimo5214
    @ashimo5214 Жыл бұрын

    38:54 both codes ARE WORNG SHOULD BE for i in range(5, 11, 2 ): print(i) NOT LIKE : x = 0 for i in range(5, 11, 2 ): x += i print(x) I get output : 21 with that code for some reasons

  • @XMegaJuni
    @XMegaJuni6 жыл бұрын

    Brilliant

  • @rupertbrunder7888
    @rupertbrunder78886 жыл бұрын

    Very nice information

  • @thomaskennedy5336
    @thomaskennedy53366 жыл бұрын

    So do we need spyder? because I'm using 3.6 and some of this doesn't seem to translate.

  • @jyvben1520
    @jyvben152010 ай бұрын

    to improve examples e.g. for string print( "you_can", "show", "where_the_spaces_are_added", "!" * 3 ) the example code blocks could have a colored background or have a colored border

  • @Clyffcarlock1
    @Clyffcarlock13 жыл бұрын

    Why isn't "Type a number..." included in the output, as it is included within the quotation marks?

  • @muthabukujohn5089
    @muthabukujohn50895 жыл бұрын

    take = "Thank you" name = "Dr. Ana Bell" print (take + ", " + name)

  • @peterpace3379

    @peterpace3379

    4 жыл бұрын

    (take, name)*

  • @geitekop507

    @geitekop507

    4 жыл бұрын

    print(take,","name,"!") is probably slightly better. ;-)

  • @blackjack-ks8zn

    @blackjack-ks8zn

    4 жыл бұрын

    @@geitekop507 (take, " ", name, "!")

  • @kasiviswanathboddeti9085

    @kasiviswanathboddeti9085

    3 жыл бұрын

    print(take+",",name)

  • @saimahossain332
    @saimahossain3323 жыл бұрын

    i have a question, how do you remove the first hashtags in a column with a shortcut?

  • @flickmew99
    @flickmew992 жыл бұрын

    I want to learn a lessong everyday if she is my teacher. I will never get tired or bored

  • @obli8984
    @obli89842 жыл бұрын

    the number you mention in parenthesis in for loop doesn't printed on the screen

  • @shohidulpramanik3506
    @shohidulpramanik35064 жыл бұрын

    Using which programming language can make CAD software?

  • @louerleseigneur4532
    @louerleseigneur45322 жыл бұрын

    thanks MIT

  • @scullyy
    @scullyy Жыл бұрын

    "b" is greater than "a" because __lt__ / __gt__ methods of the string class were made to convert the characters to ascii values and return the comparison of those values?

  • @acavaelnick
    @acavaelnick4 жыл бұрын

    Hi people, anybody could give me a hand ? I'm trying to do the fingers exercises in the textbook for this course, and in chapter 3 there is one that says: 'Write a program that takes an integer enter by the user and prints two integers, root and pwr, such that 0 I'm really strugglin with the logic there and would gladly accept some help. Thank you

  • @rithuvarnakm3575
    @rithuvarnakm35752 жыл бұрын

    I am not getting that one at 12:26 I am doing this in Google colab, Is that the problem

  • @biancapacheco1460
    @biancapacheco14608 ай бұрын

    everytime I hit print, nothing shows up in my console

  • @algemmegla9002
    @algemmegla90023 жыл бұрын

    Regarding range(stop,start,step) 40:30: Normally num-1, but in this case, we're going to the end minus "two". (num - 2). I came across a component of this topic on stackoverflow, where someone described the end of the range as "minus two", which left me puzzled, so I thought I'd post.

  • @mvisperas

    @mvisperas

    3 жыл бұрын

    Python always has the extra +1 whenever there is a range. This is different if you come from other programming languages but once you get used to it it will not bother you. Also true when slicing a string. For example: # 1 1 1 # 0 1 2 3 4 5 6 7 8 9 0 1 2 a = "hello, world!" # h e l l o , w o r l d ! b= a[1:8] print(b) # output # ello, w

  • @algemmegla9002

    @algemmegla9002

    3 жыл бұрын

    @@mvisperas In the case of range(5,11,2) From five up to but not including 11. It went 5...7...9 It stops at 9, and She says "...So we're going to the end MINUS ONE...." But actually it's going to the end, MINUS TWO. But I still agree with your comment. Normally, if it were range (5,11), with one hop as the default, it would be getting to the end (11) minus one. It was just a small thing, but thought I'd mention it. Yes, I see how you're thinking.

  • @algemmegla9002

    @algemmegla9002

    3 жыл бұрын

    Another example: Two hops. It goes to the end "minus two". for num in range(6,26,2): print(num, "", end="") 6 8 10 12 14 16 18 20 22 24 I also tried to index a range, but you have to change it to a list first because range is immutable. Range 20 up to, but not including, 50. Two hops. So up to the end "minus two". range_2 = list(range(20,50)) print(range_2[0:30:2],"", end="" ) [20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48]

  • @mvisperas

    @mvisperas

    3 жыл бұрын

    @@algemmegla9002 The end value is always the highest value without being equal to or exceeding the stop value - you can treat it as always less than. This statement is true whether the step value is 1, or 2, or 3, or whatever step value you choose. Thus if you do range(5, 11, 3) then the count is 5 ... 8. It won't do 11 as it is equal to the stop value.

  • @algemmegla9002

    @algemmegla9002

    3 жыл бұрын

    @@mvisperas I understand. Whatever is equal to the stop value gets ignored. I think we're both saying the same thing, but we're just wording our examples differently. As you mentioned in your example, you could say it stops at 11 because it is equal to the stop value, "and" you could also say it goes up to the end "minus two" (or 8) We're both saying the same thing. It's just different ways of explaining the concept.

  • @fernandocortes1187
    @fernandocortes11873 жыл бұрын

    5:00 the estar operator with strings

  • @ianmark4543
    @ianmark45435 жыл бұрын

    Could someone please explain what's the difference between the "+=" and "=+" operators?

  • @marco.nascimento

    @marco.nascimento

    5 жыл бұрын

    there is no such a sintax in python as "=+", only "+=". And "x += 1" is the same thing as "x = x + 1"

  • @TheAL9090
    @TheAL9090 Жыл бұрын

    32:21.... y no n += 1?? also loving the Corse so far, did problem sets 0 and 1a before watching this, would love to go to MIT at some point in my life to get a Comp sci degree

  • @maar2001

    @maar2001

    Жыл бұрын

    Bro where can I get the problem sets and where can I install the notes prof Ana made that she shows here?

  • @user-xj2mr7ly1d
    @user-xj2mr7ly1d4 жыл бұрын

    for the maze game, " n=input("you are in a deep forest. **************** **************** Go left or right?")"under the while loop doesn't need any print command and it just repeats itself?

  • @imrk97
    @imrk975 жыл бұрын

    what was the version of python in these courses?

  • @yuminkim7264
    @yuminkim72646 жыл бұрын

    Whenever she shows the python codes on her PC's spyder, how she change from comment to code(vice versa) so quickly by dragging? is there any short cut for that functionality?

  • @Viruz256

    @Viruz256

    6 жыл бұрын

    If you press ctrl+1 in Spyder, all marked code changes to/from comment

  • @CrushOfSiel

    @CrushOfSiel

    4 жыл бұрын

    @@Viruz256 Thank you! I was looking for this comment/answer!

  • @nickfrazier2839
    @nickfrazier283920 күн бұрын

    For the while main_condition: while sub_condition: expression_a() break # This break always happens expression_b() # This will never execute expression_c() What is the point of having expression b if it will never execute?

  • @andrewjankowski6981
    @andrewjankowski6981 Жыл бұрын

    I can't get enough my brain is finally feeling euphoric

  • 3 жыл бұрын

    28:10 While loop insted of if statement

  • 3 жыл бұрын

    19:40 three ways to make decitions

  • @fernandocortes1187
    @fernandocortes11873 жыл бұрын

    9:40 get input from user...every thing id a string, evento the numbers

  • @VeteranIRL
    @VeteranIRL4 жыл бұрын

    did any one made expanding for the code of the game that puts sad face and many tables after entering right more than two times?

  • @semtex6412

    @semtex6412

    3 жыл бұрын

    𝚗 = 𝚒𝚗𝚙𝚞𝚝("𝚈𝚘𝚞 𝚊𝚛𝚎 𝚒𝚗 𝚝𝚑𝚎 𝙻𝚘𝚜𝚝 𝙵𝚘𝚛𝚎𝚜𝚝, 𝙶𝚘 𝚕𝚎𝚏𝚝 𝚘𝚛 𝚛𝚒𝚐𝚑𝚝?") 𝚠𝚑𝚒𝚕𝚎 𝚗 == "𝚛𝚒𝚐𝚑𝚝" 𝚘𝚛 𝚗 == "𝚁𝚒𝚐𝚑𝚝": 𝚛𝚒𝚐𝚑𝚝𝚜 = 𝟶 𝚏𝚘𝚛 𝚒 𝚒𝚗 𝚛𝚊𝚗𝚐𝚎 (𝟷): 𝚛𝚒𝚐𝚑𝚝𝚜 += 𝚒 𝚗 = 𝚒𝚗𝚙𝚞𝚝("𝚜𝚊𝚍𝚏𝚊𝚌𝚎, 𝚕𝚎𝚏𝚝 𝚘𝚛 𝚛𝚒𝚐𝚑𝚝?") 𝚗 = 𝚒𝚗𝚙𝚞𝚝('𝚏𝚕𝚒𝚙𝚜 𝚝𝚊𝚋𝚕𝚎𝚜, 𝚕𝚎𝚏𝚝 𝚘𝚛 𝚛𝚒𝚐𝚑𝚝?') 𝚠𝚑𝚒𝚕𝚎 𝚗 == "𝚛𝚒𝚐𝚑𝚝" 𝚘𝚛 𝚗 == "𝚁𝚒𝚐𝚑𝚝": 𝚗 = 𝚒𝚗𝚙𝚞𝚝('𝚏𝚕𝚒𝚙𝚜 𝚝𝚊𝚋𝚕𝚎𝚜, 𝚕𝚎𝚏𝚝 𝚘𝚛 𝚛𝚒𝚐𝚑𝚝?') 𝚙𝚛𝚒𝚗𝚝("\𝚗𝚈𝚘𝚞 𝚐𝚘𝚝 𝚘𝚞𝚝 𝚘𝚏 𝚝𝚑𝚎 𝙻𝚘𝚜𝚝 𝙵𝚘𝚛𝚎𝚜𝚝!\𝚗\𝚘/")

  • @leijiang-kf9ql
    @leijiang-kf9ql Жыл бұрын

    00:19:58 if/elif/else

  • @adrikasaha7690
    @adrikasaha7690 Жыл бұрын

    do we have to use spyder ?

  • @salehaboutaama7370
    @salehaboutaama73705 жыл бұрын

    at 25:16 what's the use of the nested if? and when will it be used!

  • @maverick.3957

    @maverick.3957

    5 жыл бұрын

    To check if a condition is true inside a condition. For example If 5 == 5: If 6 == 7: Print("Hello") First it will check if 5 is equal five which is true then it checks if 6 is equal to 7 which is false so it won't print "hello" it goes from up to down. Hope that helps 😊.

  • @Oliver-nb2iu

    @Oliver-nb2iu

    4 жыл бұрын

    the nested if prints the quotient of x and y. however, you can't do this if y=0 as you will get a zero division error (if x=0 and y=0, 0/0 can't be evaluated)

  • @tahaozturk5135
    @tahaozturk51353 жыл бұрын

    As a mechanical engineer who is interested also in CS. These MIT courses are great way to learn

  • @002_abhinavsingh3
    @002_abhinavsingh33 жыл бұрын

    Thanks

  • @timarivobatis1182
    @timarivobatis11826 жыл бұрын

    how do you remove the # from multiple lines in spyder? whats the hotkey. theres probably also a hotkey to a add it. so comment/ uncomment selected lines. like at 39:48

  • @rizwanzeb5218

    @rizwanzeb5218

    6 жыл бұрын

    highlight the text and press ctrl+1

  • @abdullahchowdhury9589

    @abdullahchowdhury9589

    3 жыл бұрын

    @@rizwanzeb5218 Thank you very much... so happy to get my solution

  • @HadeelHanaysheh
    @HadeelHanaysheh6 жыл бұрын

    on the 40th minute why i has the values 5 7 9 not 5 6 7 8 9 ????? please explain !!!

  • @ryankung3244

    @ryankung3244

    6 жыл бұрын

    for range function, the parameters include start, end and steps. steps has default value of 1, therefore without explicitly specifying for the range function, you would get an iterator that output a sequence of values from 5,6,7,8,9,10 if it was range(5,11). However, since step was specified to be 2, each time the iterator will yield and output a new value equal to previous value + 2, which range(5, 11, 2) give you 5, 7, 9. Also since 11 will be greater and equal to 11, so 11 won't be part of the result for the range function.

  • @silviapabon1282
    @silviapabon12823 жыл бұрын

    Anaconda allows intereacitivty: IPython + Spyder (inspire on Matlab, (Matplotlib),+ support for other languages like ruby, R, Julia, Haskell ....etc. wow I am going to explore that tomorrow...