Introduction To Lists In Python (Python Tutorial #4)

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 1,2 тыс.

  • @ianwang934
    @ianwang934 6 лет назад +192

    You teach me more in 2 minutes than my professor does in 2 hours. Thank you.

    • @kevsatu1166
      @kevsatu1166 4 года назад +1

      Haha

    • @louisgreen3071
      @louisgreen3071 4 года назад +4

      well he did make 100k a year at google before

    • @JustinMacri007
      @JustinMacri007 2 года назад

      @@louisgreen3071 he’s a nice guy

    • @code_on_puffic
      @code_on_puffic Год назад

      I agree visual information is the best way of learning something

  • @Solify
    @Solify 4 года назад +829

    it's sad to see that the first vid has millions of views and then as every new video comes, more people start to give up

    • @saimirfan902
      @saimirfan902 4 года назад +80

      Consistency is the key to success and apparently not many people have it :v :/

    • @-butterfly-594
      @-butterfly-594 4 года назад +48

      Or it could be that people are still working on the first few videos and haven't gotten to the later ones yet. Still a lot more likely they just gave up tho, which is pretty sad

    • @tokay6467
      @tokay6467 4 года назад +5

      Lmao

    • @marckgiraldo3386
      @marckgiraldo3386 4 года назад +36

      this actually always happens in youtube playlists. if you see a game "let's play" playlist, you'll see that the views go down with every newer video.

    • @ashwinsanthosh9154
      @ashwinsanthosh9154 4 года назад +18

      Dont know why tho, it has been fun for me so far...

  • @muratsendur619
    @muratsendur619 6 лет назад +364

    I feel so lucky to find out your great channel. My programming knowledge was really low. I also have to point out that your comminication skills are extraordonary, you can easily teach whatever you want.. I will check out your all upcoming videos and please complete these series from beginning till the end. Do not break it at the mid part of all series like other youtube channels :( Thank you so much, from Turkey.

  • @baselqhawiesh3660
    @baselqhawiesh3660 6 лет назад +92

    The fact that i solved the "swap" thing in this video..make me think that i understaded what you said in the video..it felt so good when i solved it..then u said an easier way..lol
    Great vid btw

    • @justakidwithnolife5671
      @justakidwithnolife5671 4 года назад

      yaaaaa

    • @selimmiled9682
      @selimmiled9682 4 года назад

      understood*

    • @baselqhawiesh3660
      @baselqhawiesh3660 4 года назад

      @@selimmiled9682 1 year ago*

    • @ziks4547
      @ziks4547 4 года назад

      @@baselqhawiesh3660 you still doing python?

    • @baselqhawiesh3660
      @baselqhawiesh3660 4 года назад +1

      @@ziks4547 yessir , i tried it before i started at uni , but now at uni i finished my first year , now second year am learning it right now

  • @kamilbolka
    @kamilbolka 6 лет назад +79

    Also pop can take a index, so it won't just delete the last element within a list. You can say pop(0) which will pop the first element in the list.

    • @swallowedinthesea11
      @swallowedinthesea11 6 лет назад +3

      Good! The default value it pops is the last value, or someList[ -1 ], if the length of someList is 200.

    • @Caroline-pb8xx
      @Caroline-pb8xx Год назад

      thanks!

    • @ichisan13
      @ichisan13 2 месяца назад

      yes and the 'popped' item can be sored in a variable incase you might want to use it later. i.e b = a.pop() .

  • @khay9833
    @khay9833 6 лет назад +7

    I am new to Python and your first 4 videos have helped me grasp the simple concepts that used to plague me. Your teaching style is definitely something that I can follow along with! Keep the videos coming!

  • @gunpowderstudio2419
    @gunpowderstudio2419 6 лет назад +45

    You make python look so easy. And you explain it very well than other youtube channels. Thanks!

  • @quicklydecliningphilosophy
    @quicklydecliningphilosophy 2 года назад +2

    First off thank you CS Dojo for such a lovely series which has made python so understandable for us. To all the new devs/programmers, I find the best use of my time is watching one of these videos daily, looking for at least 2 other videos on the topic (for instance this one I’d follow it up with 2 other videos about lists) then come back to these videos for a refresh. It’s crazy how fast we can learn with this amazing help, thank you again!

  • @shanqism3923
    @shanqism3923 6 лет назад +126

    Thanks for the video and please continue this series...this is really helping me understanding python and I think I can do well in my exams now

  • @jamesbyford2531
    @jamesbyford2531 3 года назад +1

    I have been 'practicing' code for a year now, do not give up, it is a great skill to have and you can learn so much of you just put in that little bit of effort. If you do not understand something don't be afraid to ask or the favorite for all developers "Google It".
    Keep up practicing, you have to practice, practice, practice.

  • @P_tricc
    @P_tricc 5 лет назад +12

    This is amazing i took the code to convert miles to km to make another converter, its a converter that tells you how old you will be when for eg. your mom is 50
    The code is
    def convert(Mom):
    return Mom - the age (difference between your mom now)
    then you say
    print(convert(50))
    My family were so amazed!
    Tysm!

  • @mdvlogs5418
    @mdvlogs5418 2 года назад

    this is one of the most useful videos i have ever seen on youtube , I just switched from med to engineering and had literally no knowledge about computer and i didnt think learning python would be this essy online . i have searched for a couple of tutorials but this was the most useful one yet .Thank you so much

  • @WhoForgot2Flush
    @WhoForgot2Flush 6 лет назад +239

    You mentioned nested lists but not how to access them. Given the list a = [1, 2, 3, [10, 20, 30]] how would you get '20'? Think about whats returned when you call a[3]... answer is below.
    a[3][1] would return 20 :)

    • @swallowedinthesea11
      @swallowedinthesea11 6 лет назад +6

      Nice! Stay safe during the Coronavirus!

    • @DivineZeal
      @DivineZeal 6 лет назад +4

      Man, i searched comments long for this answer lol. Nice name too

    • @RM-gc9xx
      @RM-gc9xx 6 лет назад +3

      In my case after 7-8 minutes manually "debugging" it ;d
      print(b)
      ['microsoft', 'lala', 'apple', 'banana', [10, 20, 30]]
      Swapping 20 with 30 ->
      b[4][1], b[4][2] = b[4][2], b[4][1]

    • @suvrochoudhury1820
      @suvrochoudhury1820 6 лет назад +14

      a = [1, 2, 3, [10, 20, 30]]
      b = a[3]
      c = b[1]
      print(c)

    • @khojiakbarsirojiddinov6766
      @khojiakbarsirojiddinov6766 5 лет назад +2

      11swallowedinthesea I fixed the problem thanks to your help. Silly me! It turned out that instead of opening square bracket, i was typing opening curly bracket. BTW, I can't say thank you enough for the book. I highly appreciate that!

  • @pile333
    @pile333 6 лет назад

    You're a natural born teacher.
    To be a good teacher is an innate talent.

  • @piyushkumar11
    @piyushkumar11 5 лет назад +3

    Hi YK..Thanks for these awesome videos.
    I tried the assignment using all the topics you covered in this video and it worked.
    b.append(b[0])
    b[0] = b[2]
    b[2] = b[3]
    b.pop()
    print(b)

  • @Rhahkeem
    @Rhahkeem 5 лет назад +10

    Thanks for this series. I've been sending my students over here to get a more in depth understanding of python

  • @kamilbolka
    @kamilbolka 6 лет назад +4

    I wish you have done this 6 months ago, when i needed to learn it for my course. Better late than never.

  • @THAFUYR
    @THAFUYR 4 года назад +1

    Funny that I could solve the exercise without his help first, and it succeeded, and it was exactly his answers.
    Well done for teaching me how to crack the codes

  • @liliacfury
    @liliacfury 5 лет назад +9

    I noticed you didn't explain how to add integers or strings to lists _within_ a list. If anyone's curios, do the following:
    Input: a = [5, 10, 15, 20, [2, 4, 6, 8]]
    Input: a[4].append(10)
    Input: print(a)
    Output: [5, 10, 15, 20, [2, 4, 6, 8, 10]]
    Note that in the second line where is says "a[3]" the 3 is the index number of the list within a list. That means what's basically happening is the "a[3]" calls for that index item, which is the list that's within the original list, then appends the number "10" to it.
    Hope I helped :)

  • @rickyshey9222
    @rickyshey9222 5 лет назад

    learning python 100% beginner lol, going into computer science, this series is really helping me understand, hoping to get an internship and raise my 'value' as a viable employee as i learn many more languages, thank you...you're setting me up for a good future , appreciate it very very much

  • @sanattaori6209
    @sanattaori6209 6 лет назад +14

    Thank you yk sugishita with love from India ❤

  • @Abhinashray
    @Abhinashray 6 лет назад +21

    Awesome programming things to learn from you..thank you so much for your thought to educate everyone about programming...all best..wish u a blessing happy new year..keep educating

  • @anh-tupham6312
    @anh-tupham6312 6 лет назад

    b = ["banana", "apple", "microsoft"]
    tem = b[0]
    b[0] = b[2]
    b[2] = tem
    print(b)
    Hey YK, your "swapping two variables" video really helps!

  • @GoingBongusMode
    @GoingBongusMode 6 лет назад +9

    This series is awesome, but I would love it if you would also start an intermediate or even advanced playlist/series of python tutorials, such as sorting or creating trees. Or, consider making a pygame tutorial to teach people how to program with images and graphics, as I'm sure many people would be interested in learning how that worked. Just some suggestions! Keep up the awesome work.

  • @louisadibe3189
    @louisadibe3189 6 лет назад

    This video is awesome,i just want to add that if you want to recall a particular variable from a very long list,e.g
    a=[23,2,3,4,6,9,10,23,14,15,16,17,18,19,20],to avoid stress just know that the last variable on a very long list starts with -1
    solution-> a[-1] gives you 20.

  • @davidhandvrkerne5912
    @davidhandvrkerne5912 4 года назад +54

    My solution:
    b = ["banana", "apple", "microsof"]
    b[0], b[2] = b[2], b[0]
    print(b)

    • @quantumwarrior3780
      @quantumwarrior3780 4 года назад

      i did the same thing

    • @jersimbs7973
      @jersimbs7973 4 года назад +5

      same, saw this solution on the comment on the first video

    • @sumeshwar.bhadwal8704
      @sumeshwar.bhadwal8704 4 года назад +8

      There's one more way to swap inside a list........
      a = ["banana","apple","microsoft"]
      We can use
      a[0]="microsoft"
      a[2]="banana"
      print(a)

    • @abirahmed8643
      @abirahmed8643 4 года назад +1

      @@sumeshwar.bhadwal8704 I did that too, I think it's faster

    • @blitz09_
      @blitz09_ 4 года назад

      Abir Ahmed same

  • @randomman8591
    @randomman8591 4 года назад

    This videos get me excited because I love coding and every time I’m watch one I always learn something new

  • @fahadsiddiquijordan
    @fahadsiddiquijordan 6 лет назад +3

    Incredible video 10/10. It's so simple. you've made programming fun to learn. Thank you.

  • @VigiTi5758
    @VigiTi5758 6 лет назад

    You are by far the best teacher on you tube. Thanks man.

  • @TheNewTravel
    @TheNewTravel 4 года назад +37

    Why double quotes for strings instead of single quotes? Personal preference or is there another reason?

    • @shehriarburney271
      @shehriarburney271 4 года назад +16

      It's just personal preference

    • @Chux48
      @Chux48 4 года назад +5

      it is optional to use single or double quotes. both works super fine

    • @bitcoin_hair
      @bitcoin_hair 4 года назад +10

      For single quotes when putting a string it would be 'Hello World' But let's say I wanted to type a person saying (NAME said, "Hello World") and put that into single quotes to print it. That would be 'NAME said, "Hello World"' but double quotes wont work in single quotes and single quotes won't work in double quotes.

    • @Drakonus_
      @Drakonus_ 4 года назад +1

      @@bitcoin_hair Just use the \ function, and you're good to go.

    • @bitcoin_hair
      @bitcoin_hair 4 года назад

      @@Drakonus_ True

  • @moralesrexog.6869
    @moralesrexog.6869 5 лет назад +2

    I am 1st year in college and studying IT and I am starting to love it and finding out ur channel give me more advanve knoeledge but I wish we can also use windows language like javascript

  • @kamalsamadzadeh4221
    @kamalsamadzadeh4221 5 лет назад +15

    I would like to share the easiest way of swapping:
    a[0],a[2] = a[2],a[0]
    GOOD LUCK

    • @RandomUtuberr
      @RandomUtuberr 5 лет назад +3

      He already shared it, but thanks, dude. Also, you don't have spaces between the list indexes, so technically your code is incorrect.

    • @siddheshkn5615
      @siddheshkn5615 5 лет назад +5

      @@RandomUtuberr No need to give space between list indexes it's works perfectly. Try it.

    • @famousmc4433
      @famousmc4433 4 года назад

      Actually in the last scenario easiest way to "swap" these items in list would be a.reverse

    • @Drbhawana77
      @Drbhawana77 4 года назад

      @@famousmc4433 no if we reverse original ualue get change

  • @desy6912
    @desy6912 6 лет назад +2

    I saw this channel yesterday now I know how to make a BMI calculator and I am learning so much more

  • @shree2710
    @shree2710 6 лет назад +4

    Thanks a lot. Eagerly looking forward to the next episodes of this series. And one more request - you once had a poll on what topic you should make your next video, and one of the option was how you learned speaking English, so I'd just request if you ever make that video in future please also tell how can a non Japanese speakers can learn speaking Japanese at the age of 18.!!

    • @drcrazzy1134
      @drcrazzy1134 6 лет назад

      I think the theme of the next video is depend on what is showed on the previous one and the lesson of Python is also necessary to be in order, that's why he didn't create poll. It's just my opinion, if it's wrong, ignore it.

  • @trgiahuy1874
    @trgiahuy1874 3 года назад

    your ten minutes video are clear more than 2 hours of lesson in my university

  • @macahoao
    @macahoao 5 лет назад +4

    i did this:
    b.append("banana")
    b[0] = "microsoft"
    b.pop(2)
    print(b)
    [ 'microsoft, 'apple', 'banana' ]

    • @augustusburr
      @augustusburr 5 лет назад

      a[0] = "microsoft";
      a[2] = "banana";
      better way

  • @sandilegcaba7253
    @sandilegcaba7253 Год назад +1

    this dude knows his stuff👏👏

  • @kameshparashar
    @kameshparashar 6 лет назад +66

    Need More😋😍

  • @vdpeer
    @vdpeer 6 лет назад

    Great stuff. You are a gifted teacher. Those are the ones that make a subject interesting and simplify things. I'm not Indian, BTW, as someone down this list suggested most here are. Just an old native born with an interest in coding. Thank you for this series, and keep up the good work.

  • @consolator4745
    @consolator4745 5 лет назад +5

    you can do this too right?
    b = ("Banana", "Apple", "Microsoft")
    b[0] = ("Microsoft")
    b[2] = ("Banana")
    print(b)
    you can switch the 2 using this code right?

    • @lordkube
      @lordkube 5 лет назад +1

      yeah

    • @macahoao
      @macahoao 5 лет назад +1

      yeah, i did that

    • @BrandonDilbeck
      @BrandonDilbeck 5 лет назад

      Yes, but YK explained in the first video, about variables, to avoid doing this.

    • @rajab4187
      @rajab4187 5 лет назад +1

      You can do this but if string is too long then it's wasting of Time.. what he is doing is smart programming

  • @MehediHasan-ku3po
    @MehediHasan-ku3po 6 лет назад +1

    i have learned so much in a single day, you made things easier, though i am a chemical engineering student , i found programming very interesting watching your previous videos. plzz continue this series till the end. thank you :)

  • @sandyshah8824
    @sandyshah8824 4 года назад +18

    b[: : -1] will also reverse list

    • @ashighasapie
      @ashighasapie 4 года назад +5

      So does b.reverse()

    • @markoa5
      @markoa5 4 года назад +1

      Loooool thx guys

    • @FadingDarkness1100
      @FadingDarkness1100 4 года назад +1

      But he said to "swap" them, not reverse them. What if u had a list of 4 e.g: [ 1, 2, 3, 4 ] Now if u use the reverse command, the output will be [4, 3, 2, 1] The position of 2 and 3 is also swapped.

  • @nikhileshk7047
    @nikhileshk7047 6 лет назад +1

    For those of you, who did not get the shortcut
    b[0], b[2] = b[2], b[0] means that he is conventionally assigning b[2] to b[0] and b[0] to b[2] at the same time in one line so that the values swap the places with a single command line.

  • @tsashokstar27
    @tsashokstar27 6 лет назад +3

    Make a video for data-structures and algorithms in python

  • @uberrrmensch
    @uberrrmensch 5 лет назад +2

    7:12
    Sir, i tried the same method even though it's my first time programming. But i used the same method as you. I was shocked when i saw you took a temporary variable 😊
    May Allah bless you

    • @Simplifier123
      @Simplifier123 5 лет назад

      why were you shocked?
      It's a reference for his first lesson of variables, where he also teaches how to swap between 2 variable's contents.

  • @MrTAA-cc7eu
    @MrTAA-cc7eu 4 года назад +3

    Hey CSU jojo, when i run a.append, i keep getting an error that say 'set' object has no Attribute 'Append' what could be the reason?

    • @davidbojanovic2855
      @davidbojanovic2855 4 года назад

      Mr. TAA me too

    • @alexyeat8081
      @alexyeat8081 4 года назад

      anyone get a answer yet ?

    • @davidbojanovic2855
      @davidbojanovic2855 4 года назад

      Alex Yeat type in google, you will find in 2 min, its because () {}

    • @biologyrad
      @biologyrad 4 года назад

      This also happened to me my list is called list and I want to add the number 4 to the end I write list.append(4)

    • @davidbojanovic2855
      @davidbojanovic2855 4 года назад

      Bradley Glover () is problem, you have to use these [ ]

  • @prernasingh2398
    @prernasingh2398 3 года назад +1

    Thank you CS dojo for making these videos. It's amazing how I never gets bored watching your videos. So helpful

  • @pile333
    @pile333 6 лет назад +33

    You gave us a task to solve in the last video, a km to mile converter, so i wrote this:
    SPOILER ALLERT
    def km_to_mile_calculator(x):
    return 1.6*x
    # example 22 km to miles
    a = km_to_mile_calculator(22)
    print (a)
    35.2
    It works fine. Is it right or is there a better way to write that? Thanks in advance.

    • @swallowedinthesea11
      @swallowedinthesea11 6 лет назад +12

      Good work! What if you wanted to concatenate 'It takes 35.2 kilometers.'?
      print( 'It takes ' + str( a ) + ' kilometers.' )
      # why did I add str( a )?
      ruclips.net/video/qMZQw_SecYA/видео.html

    • @pile333
      @pile333 6 лет назад +3

      Thanks. The result would be visualized more clearly that way.

    • @Ricebow11
      @Ricebow11 6 лет назад +7

      not sure if you got you answer but you added the "str(a)" because Python cannot concatenate a string and integer. the value a is an INT. These are considered two separate types of objects.So, if you want to merge the two, you will need to convert the integer to a string, which is why you added the"str(a)". Hopefully that helps.
      reference: www.pythonforbeginners.com/concatenation/string-concatenation-and-formatting-in-python

    • @swallowedinthesea11
      @swallowedinthesea11 6 лет назад +2

      darin khath Nice!

    • @retr0k964
      @retr0k964 6 лет назад +8

      The answer that was on the file that you can download on csdojo.io/python3 is as follows:
      def convert(miles):
      return 1.6 * miles
      and then he prints a few examples:
      print(convert(2))
      print(convert(12))

  • @sandorsbox
    @sandorsbox 3 года назад

    Your videos are more helpful and informative than any of the reading assigned by my instructor.

  • @mrlokeshkumar76
    @mrlokeshkumar76 4 года назад +3

    Hey c.s. dojo.
    In this program when I run a.append
    (1) it gives an error.. what should I do

    • @shantyodell8587
      @shantyodell8587 4 года назад +1

      I also have this issue. Did you find out why it was doing it?

    • @mrlokeshkumar76
      @mrlokeshkumar76 4 года назад +1

      YA, Actually i was doing a mistake.
      in the first line it should be [ ] this backet.not () this.Always remember to start a list with[ ].hope it would help you

    • @shantyodell8587
      @shantyodell8587 4 года назад +1

      @@mrlokeshkumar76 Slightly after I asked this question I figured it out as well lol. Many thanks for the respond though.

  • @varuntiwari3049
    @varuntiwari3049 6 лет назад

    I seriously appreciate the work which you are uploading, your videos are very efficient and effective as they are providing theoretical skills along with practical which is lacking in almost all the tutorial on RUclips.
    Great work, Keep it up!

  • @vasiftagiyev1439
    @vasiftagiyev1439 5 лет назад +3

    Why don’t we do it this way :
    b =[“banana”,”apple”,”microsoft”]
    b[0] =“misrosoft”
    b[2] =“banana”
    Print(b)
    [‘microsoft’, ‘apple’, ‘banana’]

    • @ethannguyen7447
      @ethannguyen7447 5 лет назад

      that's what i thought too

    • @JustMentalMatt
      @JustMentalMatt 5 лет назад

      i did that too lol

    • @farukgurbeta2139
      @farukgurbeta2139 5 лет назад +7

      Because sometimes you dont know what is in the list. You only know that you want to swap first and third element

  • @a.ffirmative
    @a.ffirmative 4 года назад +4

    Wow, i can learn more from cs dojo than in my AP Computer Science class

  • @lukas-ru8ru
    @lukas-ru8ru 6 лет назад +3

    hi! I am running the try jupyter notebook online version on my computer. Are there things I can't do now ?
    because the append and pop does not work. any tips?

  • @Nihirra
    @Nihirra 6 лет назад

    Hello greetings from india, i lost hope doing programs but after seeing your video, now i can write my own code.. thank u for the inspiration and the way you teach is simply awesome..

  • @barkeeper7887
    @barkeeper7887 5 лет назад +3

    i did it like this is this ok??
    b[0], b[2] = b[2], b[0]
    btw i didnt understand the Video can someone explain it easier

    • @BrandonDilbeck
      @BrandonDilbeck 5 лет назад +2

      Axel Voss You have b[0], b[2] on the left, basically as two variables. Then the equal sign assigns them both at the same time as b[2], b[0] respectively.

    • @アランパーソンプロジェクト
      @アランパーソンプロジェクト 5 лет назад

      Brandon Dilbeck thanks!!

  • @NotRtg
    @NotRtg 2 года назад

    I am so happy i found your channel. without it, i would have never learned anything about python! thank you so much!

  • @rileylong7427
    @rileylong7427 6 лет назад +6

    My code for the problem was:
    b[0] ="microsoft"
    b[2] = "banana"
    Was this bad code?

  • @studentaccount131
    @studentaccount131 4 года назад

    I'm just starting to view your series today and I'm currently at this video. I see a lot of people saying that your first video had more views and it's decreasing as the videos come because a lot of people are giving up. :D I'd like to be a few of those people who won't so that's whyI'll keep supporting you and thank you very much for this tutorial.

  • @chiragmadaan5919
    @chiragmadaan5919 6 лет назад +38

    most of people are indians here like me

    • @darshanbari2439
      @darshanbari2439 6 лет назад +1

      same thing observed by me

    • @Sudarat213
      @Sudarat213 6 лет назад +2

      Chinese here

    • @pedrofernandes4050
      @pedrofernandes4050 6 лет назад +1

      I'm brazilian living in Portugal who looks like Indian so, i guess i won :) LOL

    • @Rob-zc9mt
      @Rob-zc9mt 6 лет назад +3

      Indians have been lucky with 1-British colonization--Education--English language
      2-That their culture loves education or are atleast obsessed with Education
      3-Their population against the world.
      So do not be surprised if there are 500mil educated Indians vs just 30mil philipinos ...

    • @TopTalentVoices
      @TopTalentVoices 6 лет назад +2

      i am form Tanzania

  • @nowshadislam6023
    @nowshadislam6023 3 года назад

    Your videos are truly easy to understand, none can deny

  • @echo7348
    @echo7348 6 лет назад +3

    b[0] = b[2]
    b.pop()
    b.append("banana")
    I think this is the solution to the problem.

    • @pedrofernandes4050
      @pedrofernandes4050 6 лет назад

      I feel so dumb now, cause I thought i had made it simple, and than u came along. That's a much easier way congrats.

    • @echo7348
      @echo7348 6 лет назад

      Pedro Fernandes You dont need to feel dumb. We are all just learning. Thnaks btw. Have a great day/night.

    • @RM-gc9xx
      @RM-gc9xx 6 лет назад

      Hello Echo and Pedro,
      Your comments are 8 months old so you both are probably way more experienced than me now in Python but I have to correct you for the sake of beginners like me who reads the comments.
      Your solution is actually bad which you should know by this date.
      Why? (for the begginers) - Because if you have more values after "banana", when you enter b.pop() it will pop out the last entered value which we don't want.

  • @jeremiahv6498
    @jeremiahv6498 4 года назад

    This was my solution to the practice problem.
    a = ['banana','apple','Microsoft']
    a.append('banana')
    a.pop(0)
    'banana'
    a.insert(0,'microsoft')
    a.pop(2)
    'microsoft'
    >>> print(a)
    ['Microsoft', 'apple', 'banana']
    >>>
    I'm starting to understand good algorithms vs basic. I need to start thinking about solutions that work for general problems not specific problems. Example, if the words changed in list a my solution would not work without my having to manually go and change the words. But CS dojo 's solution works no matter the objects.

  • @jagadeshwarjay
    @jagadeshwarjay 6 лет назад

    i request you to please dont stop making advanced python videos too.....very hardly after alot research i found you as a greatest teacher......

  • @morganlewis6605
    @morganlewis6605 6 лет назад

    Brilliant video series, I can not thank you enough and I think highly of your teaching abilities.
    If anyone was interested in the multiple ways you can reach the quick challenge answer, this was the code I used:
    b = ["banana", "apple", "microsoft"]
    b[0] = b[2]
    b.pop()
    b.append("banana")
    print(b)
    It's sort of cheating I think, but....

  • @xplicitbd2723
    @xplicitbd2723 5 лет назад

    I’ve been watching your tutorials and I gotta say that I love the way you say jupyter notebook. I love these videos! Thank you so much.

    • @aminjogia8659
      @aminjogia8659 4 года назад

      Can I get python pdf format notes to get deep knowledge so we can go throuh your videos and then follow notes

  • @onyinyesarah1226
    @onyinyesarah1226 6 лет назад

    These videos are honestly a life saver

  • @revathinunna1057
    @revathinunna1057 4 года назад

    Finally I found best python tutorial...thank you YK sir... thanks a ton... from India

  • @rakibulchowdhury5400
    @rakibulchowdhury5400 6 лет назад +1

    THANK YOU!!!! My cousin recommended me to you. It was the best thing he could ever tell me. Thanks, man

  • @SKZaman-tz7qn
    @SKZaman-tz7qn 6 лет назад

    Best teacher of youtube.

  • @jiaweiliu5504
    @jiaweiliu5504 6 лет назад

    It's the first time I left comment for an RUclips video. You are reeeeally helpful! Thanks a lot! Keep going!

  • @BrianGlaze
    @BrianGlaze 6 лет назад +1

    I'm loving this series. This has been really helpful in reinforcing the basics.

  • @tristanharrison7446
    @tristanharrison7446 3 года назад

    This man is single handedly teaching me Python

  • @SkyJunkie1000
    @SkyJunkie1000 4 года назад

    Your videos have been helping me so much during my intro to programming class at university. Thank you!

  • @hackeranayopp9951
    @hackeranayopp9951 3 года назад

    i am a kid 9 years old and i decided to learn coding i have found a perfect person that can make my dream true

  • @briangelpi7800
    @briangelpi7800 Год назад

    Thank you for allowing me to learn python ...you help me understand this language.....you really saved me because i am a welderjust trying to learn a better skill that uses more mind less body

  • @mauricioluisvega8342
    @mauricioluisvega8342 6 лет назад

    Is clear that you was a big dev!. You speach is very clear and easy to understand..... +10!

  • @afrozhussain308
    @afrozhussain308 6 лет назад

    Man i.love u . Ur the best .
    I've been looking for python tutorials for very long I cdnt find a correct one.coz all other RUclipsrs just strech the concept nd go slow. But ur explaination was amazing plz keep doin more of these tutorial.keep up the good work bro.

  • @osquitarlee8502
    @osquitarlee8502 6 лет назад +2

    Dojo, thank you for all your useful videos. You are a great teacher!

  • @Spencii1
    @Spencii1 3 года назад

    For the question i simply did this
    b = ["banana" , "apple" , "microsoft"]
    b[0] = "microsoft"
    b[2] = "banana"
    This worked fine. also dont forget
    print(b)

  • @scatterkeir
    @scatterkeir 5 лет назад

    I didn't use a temp, I appended b[0], made b[0] = b=[2] then I did b.pop(2). You hadn't shown use how to pop an item not at the end yet, and I guessed the syntax wrong the first time I tried it (I did b.pop([2]) and had to google it, but I love that I'm starting to get these sort of ideas based on what you've taught us.

  • @TheDevilscrap
    @TheDevilscrap 4 года назад

    You are great man !!!! Every morning before going to work I get piece by piece of your stuff Thank You !!!

  • @rbarr3t0
    @rbarr3t0 3 года назад

    Bro, I really love the way you explain. This is the first video I´ve watch, you got another subscription. Thanks to share your knowledge.

  • @daichimax
    @daichimax Год назад

    I'm very impressed with your language's skills! Thank You for Sharing Your Knowledge.

  • @ukaszferenc5249
    @ukaszferenc5249 6 лет назад

    Thanks YK! Another good day and another step in Python learning. Onwards and upwards.

  • @joeyalfaro2323
    @joeyalfaro2323 3 года назад

    the stack was explained to me like books on top of each other. zero was position 1 2 3 so you have 4 items. today it all came together. swapping part made perfect sense.

  • @hemantw76
    @hemantw76 6 лет назад +1

    # compute all multiples of 3 & 5
    # less than 100
    a = list(range(1, 101))
    print(a)
    sum = 0
    for b in a:
    sum += b
    print(sum)
    sum1 = 0
    for c in range(1, 101):
    if c % 3 == 0:
    sum1 += c
    print(sum1)
    sum2 = 0
    for d in range(1, 101):
    if d % 5 == 0:
    sum2 += d
    print(sum2)
    output
    5050
    1683
    1050

  • @MrJb45100
    @MrJb45100 6 лет назад +2

    Thanx for making this python tutorial, very helpful, easy to understand and help me to learn english by the same way

  • @72prabhatkumar91
    @72prabhatkumar91 6 лет назад

    I am from india....i like the way you guide people like me....thanx

  • @woxgamer7044
    @woxgamer7044 6 лет назад

    THX so much
    This is the first tutorial that i dont get bored of

  • @tech-mindalchemy5947
    @tech-mindalchemy5947 2 года назад

    Cs jojo is hundred times better than my University teachers.

  • @goodone687
    @goodone687 4 года назад +2

    def func(miles):
    return miles*1.609
    x = func(60)
    print(x)

    • @diegocldrn382
      @diegocldrn382 3 года назад

      It reads out "96.53999999999999"

  • @alhouseread4512
    @alhouseread4512 4 года назад

    Clear, simple short and efficient! Compliments

  • @turbomonkey80
    @turbomonkey80 4 года назад

    You're a really great teacher. You explain each step very clearly. I haven't used the IDE that you use in your tutorials, but I've written some Python in in Text Editors, and within the Blender 3D Engine. Within those programs, you just keep typing without having to run or execute after creating new functions, or defining variables. So that part gets a little confusing for me, but still.... Great job. Best teacher on the Tube😀

    • @iluvuvibez6644
      @iluvuvibez6644 2 года назад

      you use it for animation or for engineering?

    • @turbomonkey80
      @turbomonkey80 2 года назад

      @@iluvuvibez6644 I use Blender mainly for 3D modeling, and game development. I've done basic animation in it, but nothing like short film or anything.

  • @swarooprajwal8034
    @swarooprajwal8034 4 года назад

    hey YK
    i just discovered an another algorithm for swapping b[0] with b[2] :--
    b.append("temporary")
    b[3] = b[0]
    b[0] = b[2]
    b[2] = b[3]
    b.pop()
    print(b)
    that's it
    and it also doesn't require extra space like you used temp variable in first method
    but it not very effective tough
    takes a lot of time to type
    second method is best
    and thanks for making all these amazing videos

  • @dhruvalraval8078
    @dhruvalraval8078 6 лет назад +1

    You are making awesome & quality python content which is being a great help for me. Thank you @csdojo

  • @lukav200
    @lukav200 6 лет назад

    I am so late to the party since I didn't find your channel until recently, but I love it man. Can't wait to get into all the content you've created since! I just moved to Seattle and it seems that competition is heavy for tech jobs here, so I'm trying to expand my knowledge in other programming. I know a bit of Java and C++ already, so it's great to add more to my resume.

  • @mgophern
    @mgophern 6 лет назад

    The best lecture ever.

  • @eddyhypnotizer2481
    @eddyhypnotizer2481 3 года назад

    I really love your style of teaching stuff. Even my ADHD peanut brain could comprehend everything from start until finish

  • @LeaveAsItIs
    @LeaveAsItIs 3 года назад

    Yea agree with many folks here, your communication skills are very good.. 👍