CS50P - Lecture 4 - Libraries

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 174

  • @MisterK-YT
    @MisterK-YT 2 роки тому +202

    The puppets talking to each other before class starts 😂😂😂

  • @allanatal
    @allanatal 2 роки тому +151

    1:14:02
    if you add a line
    print(__name__)
    you will print the current module name, which will be "__main__".
    That's why you use:
    if __name__ == "__main__"
    which means:
    "if the module name where I am right now is "__main__", then and only then run the code below."
    The code below will usually call your main function, which, in turn, will call any other function you put in it.
    All other modules you import will be not "__main__" when the main module is your current file. Therefore, if they also have this statement (if __name__ == "__main__"), their functions will not run automatically when you import them, because this statement will be false.
    Please note that UA-cam is removing some of the underscores in my comment.

    • @tryhardjak
      @tryhardjak Рік тому +6

      omg thanks so much. you read my mind i was so confused

    • @AmericanMaking
      @AmericanMaking Рік тому +5

      Thanks for clarifying.

    • @ndwho
      @ndwho Рік тому +4

      Thank you

    • @mo.G_2020
      @mo.G_2020 Рік тому +3

      that was a huge "Gotcha", thank you

    • @LUBRICACarlosPolarisR.-zi7kl
      @LUBRICACarlosPolarisR.-zi7kl 7 місяців тому +1

      and i u try to print the __name__ in a file where its using that custom library, it will not print __main__ but the name of the file

  • @go_away_plz
    @go_away_plz Рік тому +73

    Just want to say how much I am enjoying this course so far. Thanks to David and the CS50P team

  • @alii2284
    @alii2284 10 місяців тому +16

    I'm just grateful for this incredible amazing course from this legend man and the CS50 team. I've never wished a lecture in a course to not end but I do when I watch your courses. thank you!

    • @thiabara7242
      @thiabara7242 7 місяців тому

      hmhm btw did your requests module works? i keep on getting attribute error while using cs50dev while implementing this course

  • @LAAL0_O
    @LAAL0_O 7 місяців тому +103

    can't wait for the exercise to be 100x harder than this lecture.

    • @halalmon
      @halalmon 7 місяців тому +8

      Fr fr

    • @poluefemus
      @poluefemus 7 місяців тому +16

      cs50x was way worse so far

    • @cagedblue85
      @cagedblue85 6 місяців тому +1

      1000

    • @halalmon
      @halalmon 6 місяців тому +4

      @@cagedblue85 it's not that hard guys just some libraries and stuff

    • @tomuchtosay16
      @tomuchtosay16 3 місяці тому +6

      That is how learning works. If you were provided all the answers in-context you wouldn't be learning. You'd be repeating.

  • @speedsystem4582
    @speedsystem4582 5 місяців тому +9

    My God, his teaching skills are insane. His communication skill, flow and organization of thoughts. Damn, could I ever get there...

    • @alwaysleaping
      @alwaysleaping Місяць тому +1

      I remember reading/watching something ages ago where David explained that he developed his teaching skills by watching other teachers do things well and badly, analysing exactly what do to and avoid, and - ta da! - that’s why he’s so good 😊

    • @speedsystem4582
      @speedsystem4582 Місяць тому

      @@alwaysleaping Ohh, that's such a nice thing to know. Honestly, I would probably have imagined it as an innate thing he was born with

  • @mashudbahi
    @mashudbahi 2 роки тому +44

    Great Work Sir. CS50 has done a great social work for the people eager to learn coding.Thanks again

  • @mahipalmahato7648
    @mahipalmahato7648 2 роки тому +41

    7:37 prog1 10:34 prog2 13:15 prog3 15:23 prog4 19:30 prog5 24:50 prog6 28:38 prog7 30:49 prog8 42:43 prog9 1:02:09 prog10 1:05:49 prog11 1:08:04 prog12 1:12:44 prog13 1:13:56 prog14 1:15:22 prog15

  • @nimbabul8384
    @nimbabul8384 Рік тому +7

    This is a priceless opportunity to have access to lessons like this. Thank you so much.

  • @Bruno-rm9er
    @Bruno-rm9er Рік тому +10

    one of the best lessons between cs50x and python

  • @lmaoded1
    @lmaoded1 9 місяців тому +1

    for the past couple of weeks, I was trying to remember the band Weezer and their songs, but I just couldn't. who knew I would find them again in a CS50 lecture. crazy how life works

  • @GrimmReaper3185
    @GrimmReaper3185 4 місяці тому +2

    out of all the possible lectures i happen to end up with this one somehow, well it was the pressure of ''tutorial hell'' phase that landed me here and now i only feel confortable to watch this one with puppets and learn. what a weird world we live in.
    I am so happy to reach so far. i cant balieve i came this far, i knew nothing from looking at any code and now i know so much from 3 weeks back to now. I feel like the last half of this cource gonna be very hard. hope now. so far its been going smooth, well if i look back not that smooth, i had my ups and downs, crying and forcing myself to continue. I never enjoyed studying like this before in my life.

    • @Husain_bohra
      @Husain_bohra Місяць тому

      Seems like you learnt the art of wanting to study more and more kudos to you,
      how far have you reached today after 8 weeks of this comment?

  • @RomiVa...
    @RomiVa... 5 місяців тому +2

    Thank you for the fantastic session, David! You're the best!

  • @derickmcwilliams8089
    @derickmcwilliams8089 Рік тому +4

    Great presenter! Very well organized! Thanks for publishing this!

  • @Innovative_Mind546
    @Innovative_Mind546 6 місяців тому +4

    API's section I love the most
    God Bless you David Malan

  • @percys8774
    @percys8774 2 роки тому +17

    As usual good lesson and extremely difficult.

  • @evachen8623
    @evachen8623 Рік тому +2

    I got no words to describe my appreciation but turned out only able to say David Malan is Awesome.

  • @jiaruiyi9010
    @jiaruiyi9010 Рік тому +5

    Salute you, David. That's awesome, you are a great educator!

  • @freezyAndHaze
    @freezyAndHaze 2 місяці тому

    Thanks again for these epic videos with king David Malan!

  • @JonahDOrsky
    @JonahDOrsky 5 місяців тому +1

    Dude this lecture is absolutely insaneeee

  • @anuradhamishra337
    @anuradhamishra337 2 місяці тому

    Awesome musical podcast👌 shilpa mam ke behtareen gaano ko sunkar maza a gaya ❤ amazing shandar 🙏

  • @motivationhaven5560
    @motivationhaven5560 10 місяців тому +2

    ❤am riding this to the end, thanks a lot prof

  • @sayori3939
    @sayori3939 2 роки тому +8

    1:06:13 knowing how to manipulate/read data from these structures are so important

  • @CronosAI
    @CronosAI 4 місяці тому

    In 33:23, David says that it is better to keep all of your error handling separate from the code you really care about. But I think that checking first if there is an error could execute more lines of code unnecessarily. You expect that most of the time the code will not have an error, so it might be better to check if we can proceed without errors first, and then verify which error we have.

  • @williamenur3404
    @williamenur3404 2 роки тому +11

    Taking and watching CS50 is really like enjoying favourite movie😎

    • @1tubax
      @1tubax 2 роки тому +5

      Imagine if humans watched stuff as informative as this instead of stupid Netflix movies. We'd be living 1000 years into the future.

    • @williamenur3404
      @williamenur3404 2 роки тому +1

      @@1tubax 😄😄1000%True

    • @89wings44
      @89wings44 Рік тому

      ​@@1tubaxthat starts at home once we mandate informative content for our youngins

    • @chikomedia
      @chikomedia 13 днів тому

      @@1tubax look at it this way, Netflix itself is a result of implementation of these technologies, "stupid" is relative.

    • @1tubax
      @1tubax 13 днів тому

      @@chikomedia strong men (inventors) create easy times (Netflix) which create weak men

  • @eliecerzuletabaez6641
    @eliecerzuletabaez6641 Рік тому +7

    4:17 "A coin that in the US has heads or tails" I'm not from the US but I've never seen a coin with three sides David.

    • @bobhuffman7412
      @bobhuffman7412 6 місяців тому

      I think what he is trying to say is, all current US coins have a head of a famous US person on one side, while, a euro may not have a picture of a person's head on a side of the coin. Historically, "heads" referred to the image of the king or queen on one side of the coin.

  • @ChibDibs
    @ChibDibs 2 роки тому +5

    Great question at the @50:00 minute mark.

    • @BullCraftMaxx
      @BullCraftMaxx 10 місяців тому

      This guy always ask such great questions

  • @ТатьянаЛарина-ш8у
    @ТатьянаЛарина-ш8у 2 роки тому +4

    Дуже добре. Мені сподобалося як Ви викладаєте матеріал

  • @luthfiyyahamari7464
    @luthfiyyahamari7464 2 роки тому

    Good closing 👍, "goodbye, world"

  • @muzammilomarzoy6616
    @muzammilomarzoy6616 Рік тому

    00:19:13 - Command-line Arguments, sys

  • @MrWardo2009
    @MrWardo2009 2 роки тому +4

    Thank you for making this video!

  • @shedflips
    @shedflips 4 місяці тому +1

    My first watch through of this one - question - why would you use argv() instead of an input statement? What is gained here? Thanks

    • @davidjmalan
      @davidjmalan 4 місяці тому +4

      Often more convenient (i.e., faster) to provide input to programs via the command line, rather than wait to be prompted to provide one value at a time!

    • @shedflips
      @shedflips 4 місяці тому

      @@davidjmalan Thank you David, I'm sure it will become apparent once I use it more. This class is awesome

  • @MuhammadHuzaifa-m2d
    @MuhammadHuzaifa-m2d 5 місяців тому

    58:19 Didnt know David was chill like that 🥶

  • @phol5082
    @phol5082 Рік тому

    19:00
    12/15/23
    33:00
    Slice

  • @sedo7
    @sedo7 2 роки тому +2

    17:01
    why i got this error when i typed exactly the same codes?
    AttributeError: partially initialized module 'statistics' has no attribute 'mean' (most likely due to a circular import)

    • @DYNAMICFAJALYT
      @DYNAMICFAJALYT 2 роки тому

      I think your python doesn't have pre-installed statistics library

    • @amitKumar-xn1bt
      @amitKumar-xn1bt 2 роки тому

      pip install statistics in terminal window

    • @Don_Modern_Ancestor
      @Don_Modern_Ancestor 2 роки тому +7

      had same issue. It was because I named the file 'statistics.py'. I changed the name and it worked. You may have the same clash in your working directory.

    • @sedo7
      @sedo7 2 роки тому +1

      @@Don_Modern_Ancestor yes it was the problem that i realized already, thanks anyway

    • @Don_Modern_Ancestor
      @Don_Modern_Ancestor 2 роки тому +4

      @@sedo7 I figured you had, but I posted there if others come across the same issue.

  • @ChristopherBruns-h6k
    @ChristopherBruns-h6k Рік тому +1

    21:20; This would be a scenario that would benefit by importing with from, as like:"from sys import argv"(?). Because sys - is my answer. 43:58; I actually invited someone whose name is argv - what do i do now? Help!(!).

  • @Wizxrdry
    @Wizxrdry Рік тому +2

    As a learner who is still in the early stages, I tried to mess around with random. I named the file random.py since I was going to be testing the use of random. Everything single thing I tried kept giving me the same error. I copy pasted examples from different sites and nothing worked. Turns out it's because I named the program random.py. I changed the name and everything worked flawlessly.
    It might be obvious to some but it's not been mentioned in any video I've seen

    • @maitreverge
      @maitreverge 10 місяців тому +1

      Came up with the same problem... if you're using a module (in your example random) and your file is also named `random.py`, turns out Python tries to access your file random.py itself instead of the module, and it is called a "Circular Import" ! Renaming our file is indeed the way, thanks for mentioning it !

    • @Patriot513
      @Patriot513 3 місяці тому

      I did the same thing haha. Had no idea what was wrong so I asked chatgpt. It gave me the answer.

  • @marticus9170
    @marticus9170 2 роки тому +5

    How do I know, or how can I decide when to use exceptions and when to use conditionals?

    • @danielgray8053
      @danielgray8053 2 роки тому +11

      so you want to use an exception when you can anticipate that python could possibly crash. And when I say crash, I simply mean, not run. Meaning any case where python will throw some error of any kind. I know you have seen this before, like what happens when you try to run print("hello world" and forget to close the parenthesis. Python will crash and it will complain by showing you a kind of confusing looking message. SO, another more relevant example where you can anticipate python might crash is when you are passing a user input into the int() function. I love actually testing how functions will act myself by always having a python shell open where I can just run one line commands. Or if you are new to the idea of a shell, you can just have a separate python file open where you are just testing simple one liners like what python does when you run int(5) or int("5") or int("hello"). if you were to test those out, you would see that int(5) doesn't throw an error of course, and int("5") also doesn't throw an error even though "5" is a string. But int("5.5") actually throws an error! and more importantly for my discussion here, int("hello") throws an error. Meaning your program will actually crash if you ever pass letters into the int function. Crashing is no good. There is no conditional whether it be if, else, or elif that will prevent a crash. Won't matter what conditionals you got if your program crashes. So what you need in this case is a try and except. you would try running userInput = int(input("Please input some stuff")) , realizing that you are in danger of your programming crashing if the user puts in letters so if the user puts in an integer, your code will go to the try block. if the user inputs numbers but saved as a string, you are still good it will go to the try block, but if the user inputs letters, now it will send you to the except block and execute whatever code is there in the except block. IT DOES THIS INSTEAD OF CRASHING.

    • @marticus9170
      @marticus9170 2 роки тому +1

      @@danielgray8053 Thanks :)

    • @danielgray8053
      @danielgray8053 2 роки тому

      @@marticus9170 how's it going with the assignments , which one are you on?

  • @mamadoubhoyediallo6439
    @mamadoubhoyediallo6439 Рік тому +3

    I think we can just write " from random import* " or " from sys import* " without adding choice or any other function and then if we want to use functions like choice or argv we have just to write choice() or argv() etc.... Am I right?.

  • @All_Kraft
    @All_Kraft 2 роки тому +4

    Perfect as always

  • @decrepit1
    @decrepit1 5 місяців тому

    Incredible....EXCITING!!!!

  • @adam.m.rosman
    @adam.m.rosman Рік тому

    43:01 if sys.argv[1:3] prints sys.argv[1] followed by sys.argv[2] why doesn't sys.argv[1:-1] print sys.argv[1] followed by sys.argv[0] which would output "hello, my name is David" followed by "hello, my name is name.py". that makes slices behave consistently so that the colon always means print FROM the value to the left of the colon(inclusive) TO the value to the right of the colon(non-inclusive)

    • @valerieyip4595
      @valerieyip4595 Рік тому

      Slicing in python actually takes 3 arugments: [start index : end index : step].
      A negative number would mean reversing the direction and counting from the right of the list.
      For end index, -1 in [1:-1] means that the program stops at 1 element before the end of the list. This is useful because we may not always know the length of the list, and thereby the exact index of the last item. This syntax allows us to exclude the first and last element and get all the values in between, without knowing how many item is in the middle.
      Furthermore, step by default = 1, which means the program would increment through every element in the list. Overriding the step can make us jump through some elements of the list.
      e.g. [1, 2, 3, 4, 5][::2] -> [1, 3, 5]
      If the step takes a negative number, the direction of incrementing would be reversed.
      e.g. [1, 2, 3, 4, 5][::-1] -> [5, 4, 3, 2, 1]

  • @muhammadehtisham1593
    @muhammadehtisham1593 5 місяців тому

    I'm writing the exact same code of sys module at 23:42, but it's not working for me. Can anyone point out that what could be the possible reason?

  • @pwenixgod4806
    @pwenixgod4806 Місяць тому

    why dont i get terminal with doller sign or the one like David uses. How can i fix this . i am using vs code and i cant use sys.argv properly due to this

  • @wildgorilla1205
    @wildgorilla1205 8 місяців тому

    Awesome lecture!

  • @TheCuteHedgehog_
    @TheCuteHedgehog_ 9 місяців тому +1

    While I value the practical nod to Weezer (or Rage Against The Machine - Tom Morello), it's crucial to acknowledge that the foundation for cybersecurity tools such as Cloudflare Turnstill begins from ua-cam.com/video/MztLZWibctI/v-deo.html onwards.

  • @ydscolbotu3967
    @ydscolbotu3967 23 дні тому

    I m using pycharm IDE. But ı can't write anyting in console. Previously I just click on run button but know things are changed . Pls help me !!!!

  • @adityakharbanda3290
    @adityakharbanda3290 Рік тому +2

    Has someone completed this course in like a week or so? Coz I'm 4 days into this course and I'm already on this lecture.
    Also, does this course get increasingly difficult after this week?

    • @intxcated
      @intxcated Рік тому +1

      how did it go?

    • @floki0407
      @floki0407 Рік тому +1

      ​​@@intxcatedfinishing lectures isn't that hard😂.... 4 days 4 lecture??? Did even practice a little😂... There is no use of lectures its just to guide you ...focus more on problem sets by cs50 and other resources

    • @bfogelstrom
      @bfogelstrom 10 місяців тому +1

      Wow, you are sooo much smarter than everyone else! Did you also complete all 4 problem sets that have 21 exercises in 4 days? I won't wait for your answer.

    • @gesine759
      @gesine759 10 місяців тому

      I'm five days into the course and completed all the problem sets so far. Have spent around two to four hours a day solving the problems. So it's definitely possible to get this far in four days. I have some prior experience in Python tho.

  • @caseyspaulding
    @caseyspaulding 2 роки тому +6

    Thanks! Brilliant

  • @setsototitipana8433
    @setsototitipana8433 Рік тому

    Regarding APis: how do we find APIs, be it for gmails or UA-cam or any other site and how would you go about a problem with sites that require passwords and usernames

  • @osmansafi4517
    @osmansafi4517 Рік тому

    best use of "good bye"

  • @NikiruSan
    @NikiruSan 10 місяців тому

    Guys! Do I need to learn all of the methods in the random module?

  • @maximpasechnik4828
    @maximpasechnik4828 5 місяців тому

    the moduie cowsay doesn't work on my computer...
    AttributeError: module 'cowsay' has no attribute 'cow'

  • @mustafasallm8225
    @mustafasallm8225 6 місяців тому

    محمد عمر الي مشرفنا ورافع رسنا

  • @sparklemore2
    @sparklemore2 5 місяців тому

    Whenever I use pip to install a package, once I run the program I get a reportMissingModuleSource Error how should I solve the problem

  • @Nmdt-d
    @Nmdt-d Рік тому

    They are many different CS50 which one did you do? Thx

  • @MuhammadQasimZee
    @MuhammadQasimZee Рік тому

    I have one regarding the use of Api . If we enter the value of limit that not exist what happen in that situation?

  • @janichem7864
    @janichem7864 Рік тому

    Hello Sir with all your respect
    I want to tell you ,This leacture is quite hard and most of the concepts are not clear..I think the main reason is visual code, because my visual code window is not appear similar as you show on your video leacture.If possible kindly upload a detail video related to visual code step by step.

    • @davidjmalan
      @davidjmalan Рік тому +1

      Best to use code.cs50.io !

    • @izzyjobe9757
      @izzyjobe9757 Рік тому

      Read the documentation for each of the packages/libraries/ modules and the functions used in the program then you will understand. Without reading the documentation it’s hard to understand what’s going on

  • @MoustaphaSow-cc8mq
    @MoustaphaSow-cc8mq Рік тому +5

    for i in range(1000000000000000)
    print("THANK YOU SO MUCH!")

  • @activechaos128
    @activechaos128 2 роки тому +1

    why is my terminal not working the same way?

  • @ChristopherBruns-h6k
    @ChristopherBruns-h6k Рік тому

    Can we take the exam per coarse? Like, here . erm ... or nevermind.

  • @tanvirmahfuzapurbo7839
    @tanvirmahfuzapurbo7839 Рік тому

    cowsay library is giving me troubles.
    I did install it. but it is not giving me the functions.
    for example "cowsay.cow("string) is giving me error.
    AttributeError: partially initialized module 'cowsay' has no attribute 'cow' (most likely due to a circular import)
    what is happening here exactly???

    • @shazilhamzah1
      @shazilhamzah1 11 місяців тому

      library not installed i guess

    • @maitreverge
      @maitreverge 10 місяців тому

      A bit late, but I came up with the same problem... if you're using a module (in your example cowsay) and your file is also named `cowsay.py`, turns out Python tries to access your file cowsay.py itself instead of the cowsay module, and it is called a "Circular Import" ! Renaming your file is the way, hope it helps :)

  • @prathamsolanki742
    @prathamsolanki742 2 роки тому +2

    My sys.argv is not executing properly. When I am providing index its showing some error. Please help
    Not index error

    • @sayori3939
      @sayori3939 2 роки тому

      But you didn't show the code nor the error name

    • @prathamsolanki742
      @prathamsolanki742 2 роки тому

      @@sayori3939 I actually solved it I just needed to change my compiler path.
      But thanks for concern

    • @sayori3939
      @sayori3939 2 роки тому +2

      @@prathamsolanki742 '0' hehe i remember there were ine time i messed mingw path and i had to reinstall vs code ._.

    • @sneak5668
      @sneak5668 2 роки тому

      @@prathamsolanki742 how did you changed the compiler path

  • @surbhivishwakarma8007
    @surbhivishwakarma8007 11 місяців тому

    if len(sys.argv)

  • @Innovative_Mind546
    @Innovative_Mind546 6 місяців тому

    great sir love you

  • @thePRECIOUS_1
    @thePRECIOUS_1 Рік тому

    i dont know what the f is happening with vs code i m not able to use any of the interface codes.

  • @bigbro1815
    @bigbro1815 10 місяців тому

    Thanks David

  • @savdoyiodam
    @savdoyiodam Рік тому +1

    Thank you so much!

  • @not_amanullah
    @not_amanullah 10 місяців тому

    This is helpful ❤

  • @antonkal
    @antonkal 2 роки тому +3

    Are there problem sets or just the regular cs50x?

  • @cleidysbrooks
    @cleidysbrooks 2 роки тому

    Start again Thanks.

  • @peterschmitt9802
    @peterschmitt9802 2 роки тому

    Where do I report a problem with check and submit?

  • @sparkz1330
    @sparkz1330 2 роки тому

    How can we use len function on a function , #len(sys.argv)>2
    can we use function in the len function's argument

    • @aymenslim9900
      @aymenslim9900 2 роки тому

      yes like when you use int() and input like num1=int(input("enter an number"))

    • @sparkz1330
      @sparkz1330 2 роки тому

      @@aymenslim9900 Thanks a lot , it helped me

    • @winstonbarendse3647
      @winstonbarendse3647 2 роки тому +2

      @@sparkz1330 though, it's worth noting that sys.argv is not a function in the sys library, it's technically a variable.
      So in this example, len(sys.argv), you're using a function:
      #len()
      and passing it a variable as an argument:
      #sys.argv

    • @winstonbarendse3647
      @winstonbarendse3647 2 роки тому

      @@sparkz1330 also, in the example:
      num1 =int(input("enter a number"))
      You can technically pass the input() function as an argument to the int() function, because the int() function can take strings as an argument, as long as it's a string of integers (eg. "123"), and the input() function returns a string. If you the input() function returned words (eg."cat"), it will cause a runtime error, as you cannot convert "cat" into a string.

    • @winstonbarendse3647
      @winstonbarendse3647 2 роки тому +2

      To answer your question though.
      If you want to pass one function to another as an argument, take into consideration the parameters of the function you're passing the argument to (what data type does the function take as an argument? A string? An int? A list?), you also need to take into consideration what data type does the function you're passing as an argument return (does it return a string? An int? A list?).
      Just make sure that the return data of the one function matches the data type of the parameters of the other function, then yes, you can pass a function as an argument in another function.

  • @billbullboy
    @billbullboy Рік тому

    i watched 3 lesson in 1 days fun learning. like cowsay haha and new memory brain know about __name__ == "__main__" use for . Thanks Ph.D david

  • @desodenis
    @desodenis 2 роки тому

    hello,for the cowsay part i did everything as you told, in pycharm and it tells me "No such file or directory ". I am quite sure it is the exact same file I'm using. I also tried it on VSC it also gave me the same warning? can anyone possibly help me? my file's name is say.py just like sir david's. i type the python say.py name on the terminal. i have the packages downloaded as well

  • @tornovdutta1720
    @tornovdutta1720 2 роки тому +5

    Happy rakhsha bandhan form india

  • @aaravjagga4613
    @aaravjagga4613 9 місяців тому +3

    all countries united here

  • @odnabd3213
    @odnabd3213 Рік тому

    Can someone correct my code please:
    import sys
    Print("Hi I'm", sys.argv[1])

    • @naomiparsons462
      @naomiparsons462 Рік тому

      Print has a capital P, although maybe that's just an error within the UA-cam comment. Otherwise, looks fine

    • @odnabd3213
      @odnabd3213 Рік тому

      @@naomiparsons462 in my code the 'p'
      Was'nt capital 🫤

    • @basedmoment9857
      @basedmoment9857 11 місяців тому

      dont use '

  • @adityakharbanda3290
    @adityakharbanda3290 Рік тому

    Does someone have a verified certificate of this course? Do you feel any actual benefit of that?

    • @redeux
      @redeux Рік тому +3

      verified certificate might be accepted as credit in some degree programs, or some employers may be willing to to use the edx course in a professional development program. Generally speaking, certificates are good to have, but prospective employers probably aren't going to care about whether or not CS50 Python certificate is the free version or verified (paid) version. At a certain point, you'll want to have open source projects to demonstrate your ability. The same is true about college degrees as well-- College degrees are good to have but what is more important is having done things with the certificate/degree to demonstrate your proficiency.

  • @Sobrietyyy
    @Sobrietyyy Рік тому +1

    1:07:21 if we treat whatever stored in variable "o" as a python code and follow along the loop, the "result" variable at line 12 returns as the list that stores the dictionary that holds the key "trackName" so essentialy we are accesing the value paired with the key "trackName" from a list called "result". but since the code worked anyways i'm guessing iterating a json data isn't as same as iterating python data or i'm making a mistake please drop a reply if you think you know what's going on

  • @not_amanullah
    @not_amanullah 10 місяців тому

    Thanks ❤

  • @swagsnail5881
    @swagsnail5881 Рік тому

    57:00

  • @georgimmitev
    @georgimmitev 8 місяців тому

    15:48

  • @huwrw007
    @huwrw007 2 роки тому

    50:00

  • @vianegativa07
    @vianegativa07 10 місяців тому

    53:28

  • @train9687
    @train9687 Рік тому

    58:10

  • @Half_Channel
    @Half_Channel Рік тому

    54:01

  • @FrederickFIintstone
    @FrederickFIintstone 8 днів тому

    Prof Malan likes Weezer. What a chad

  • @Analyzing_eye
    @Analyzing_eye 9 місяців тому

    i didnt understand last one

    • @relaxer7329
      @relaxer7329 9 місяців тому +1

      If --name-- == "--main--"
      Means if the the name of this file which is sayings.py have the main function excute main in this file only.
      And in this way say.py which we import the function hello from , will not excute main but only hello ...

    • @Analyzing_eye
      @Analyzing_eye 9 місяців тому

      @@relaxer7329 thanks

  • @eemdee7188
    @eemdee7188 Рік тому

    if __name__ == main

  • @sayori3939
    @sayori3939 2 роки тому +1

    He actually installed cowsay....

    • @sayori3939
      @sayori3939 2 роки тому +2

      Imagine if you go to the restroom and when yiu come back you see this 50:00

    • @amitKumar-xn1bt
      @amitKumar-xn1bt 2 роки тому

      everyone did xD

    • @sayori3939
      @sayori3939 2 роки тому

      @@amitKumar-xn1bt i actually thought about installing it :3 but sadly I'm too deep into my havk code to do it ._.

    • @amitKumar-xn1bt
      @amitKumar-xn1bt 2 роки тому

      @@sayori3939 havk code ? :D

  • @kojak_koz
    @kojak_koz Рік тому

    1:8:38 HAHAHAH yaani

  • @HuntingtonCora-c7j
    @HuntingtonCora-c7j 3 місяці тому

    Hernandez Sandra Lee Thomas Anderson Matthew

  • @genelorenzsarmiento
    @genelorenzsarmiento 2 роки тому

    Pers

  • @phol5082
    @phol5082 Рік тому

    32

  • @spoorthynmurthy8586
    @spoorthynmurthy8586 2 роки тому

    In this scenario,
    If we know for a fact that probability of entering the name correctly is high, then is it a good design to have this condition tested first in the if loop?
    If len(sys.argv) == 2:
    print("hello, my name is", sys.argv [1])
    Code:
    1 import sys
    2
    3 if len(sys.argv) < 2:
    4 ... print ("Too few arguments")
    5 elif len(sys.argv) > 2:
    6 •• print ("Too many arguments")
    7 else:
    8 ... print("hello, my name is", sys.argv [1])

    • @winstonbarendse3647
      @winstonbarendse3647 2 роки тому +1

      It will probably come down to preference, as it would technically be the same code, but just the conditions and the else block changes.
      If you start with "if len(sys.argv)==2:", you will then have to add an elif to test one of the conditions (eg. "if len(sys.argv) > 2:"). Since you've tested bigger than and equals to, you can use the else statement as there's only one other option (smaller than).
      Again, in essence, this is pretty much the same code as the one in the video. It's probably only "better" if you have a preference for testing the == condition first, but it doesn't really improve the code in any way.

    • @spoorthynmurthy8586
      @spoorthynmurthy8586 2 роки тому +1

      @@winstonbarendse3647 thanks a lot for explaining. Cheers.

  • @mahipalmahato7648
    @mahipalmahato7648 2 роки тому

    sratrt at: 39:06