Lecture 2: Strings, Input/Output, and Branching

MIT 6.100L Introduction to CS and Programming using Python, Fall 2022
Instructor: Ana Bell
View the complete course: ocw.mit.edu/courses/6-100l-in...
KZread Playlist: • MIT 6.100L Introductio...
This lecture discusses the core elements of programs: strings, input/output, f-strings, operators, branching, and indentation. Big idea: Debug early, debug often. Write a little and test a little. Don’t write a complete program at once. It introduces too many errors. Use the Python Tutor to step through code when you see something unexpected!
License: Creative Commons BY-NC-SA
More information at ocw.mit.edu/terms
More courses at ocw.mit.edu
Support OCW at ow.ly/a1If50zVRlQ
We encourage constructive comments and discussion on OCW’s KZread and other social media channels. Personal attacks, hate speech, trolling, and inappropriate comments are not allowed and may be removed. More details at ocw.mit.edu/comments.

Пікірлер: 56

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

    what a time to be alive, following MIT lectures from a tiny town in Morocco, preparing to join a computer science school next year.

  • @OmarTravelAdventures

    @OmarTravelAdventures

    Ай бұрын

    I agree my dear Fouad...we have achieved so much...yet humans are still fighting over myths that are thousands of years old. I am looking forward to the day we are replaced by non-biological entities or just become mathematical abstractions in a perpetual computing machine (smile).

  • @fouadmajidi2568

    @fouadmajidi2568

    Ай бұрын

    @@OmarTravelAdventures comme disent les français pour quoi pas, perhaps one day humanity makes a big leap in morality and rationality as we did in natural sciences and technology. Glad to communicate with you, Mr Omar.

  • @kenydemeza

    @kenydemeza

    Ай бұрын

    Good luck bro

  • @apartmentreef

    @apartmentreef

    14 күн бұрын

    Nice! It's about time that people get access to good free education regardless of where they spawned into the game.

  • @OmarTravelAdventures

    @OmarTravelAdventures

    13 күн бұрын

    @@apartmentreef "love: spawned into the game"

  • @cloey_b
    @cloey_b29 күн бұрын

    Dr. Ana Bell is an mazing Proffessor. I'm loving this classes. Thank you SO much MIT!

  • @user-ug9hh9dt1o
    @user-ug9hh9dt1o25 күн бұрын

    Dr. ana bell is a very impressive mentor thank you so much professor

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

    New to programming and so grateful I live in the day and age where I can supplement my learning with MIT courses. Thank you!

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

    Great job Ana! Coming from a family of teachers I appreciate your teaching style and ability to make each point clear with useful examples. I am going back to college (after 20 years of running a business) and I feel like I will be ready to understand the basics of programming from studying this series of videos. Well done. Thank you so much.

  • @tmo314
    @tmo31416 күн бұрын

    Chapters: 00:00 - Recap 04:48 - Strings 13:12 - Slicing 29:26 - Input/Output 39:39 - Practice 46:58 - F Strings 50:18 - Booleans 1:02:29 - Branching

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

    We extend our heartfelt gratitude to MIT for providing this valuable course. It fulfills our needs perfectly. ❤

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

    I´m new to programming. These lectures are amazing. Thank you MIT.

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

    When highschool seniors apply for the MIT in Hollywood movies, they always do the craziest stuff with programming. Only to learn string concatenation in Python after they have been accepted.

  • @andiuptown1711

    @andiuptown1711

    Ай бұрын

    Only for the first week 😏

  • @RagHelen

    @RagHelen

    Ай бұрын

    @@andiuptown1711 You're mistaking hard for elementary.

  • @TheDoc-Worker
    @TheDoc-Worker4 күн бұрын

    FYI, I'm recording all the readings for this course over on my channel--I show the text on screen as I read it aloud. Once I'm done with that playlist, you'll technically be able to absorb all material for this course without ever leaving KZread, just as the founding fathers intended

  • @brucefrizzell4221
    @brucefrizzell422111 күн бұрын

    The 1080p is very nice . Thank You .

  • @joeberry1468
    @joeberry146813 күн бұрын

    Computer science was my first major but life took a turn and I became a nurse. After 15 years, I still want to get my degree in CS. These videos are cool, the teacher is great!

  • @chuck_dane

    @chuck_dane

    8 күн бұрын

    hey! same boat. except i got into marketing instead.

  • @falloutfromunicorn
    @falloutfromunicorn9 күн бұрын

    This is a very good first programming class, Danke Schön!

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

    Good instructor 👩‍🏫

  • @bit-oliver
    @bit-oliver29 күн бұрын

    WOW gracias por el aporte Dios Bendiga America.-----God bless America

  • @KoamiviKELEDOME-wr2ys
    @KoamiviKELEDOME-wr2ysАй бұрын

    Thanks ! ❤

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

    print(' '.join([verb]*5))

  • @alb12345672
    @alb1234567227 күн бұрын

    I taught in a community college, very similar course.

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

    How many of you affection towards your teacher ❤ 🎉

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

    Nice lesson madam ❤

  • @Paradoxonium990
    @Paradoxonium99012 күн бұрын

    The lecture is good, but I wasn't able to do the problems in the PS1 by watching this lecture and going through the recommended textbook recommended by the course (till section 2.4). I had to watch lecture 3 and go through loops section of the textbook.

  • @yuramushi
    @yuramushi12 күн бұрын

    I dont know why but i somehow figured out that if I typed in the text editor while the try it out portion was paused text=input("I can _ better than you! ") question=("I can run better than you!") print(question,text*5) it will print out the question but obviously i forgot that i could use quotation marks to add a space so i used an '_' to add the missing verb this lecture is awesome

  • @alokprakhar
    @alokprakhar26 күн бұрын

    i am from slum area of india but u made me a believer

  • @Qasimyousaf-zw5kw
    @Qasimyousaf-zw5kw26 күн бұрын

    I am from Pakistan . This is very informative python series

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

    GOOD VIDEO😃👍

  • @khudaijakousar8930
    @khudaijakousar893019 күн бұрын

    Teaching method is good

  • @muhammadnawab3959
    @muhammadnawab395914 сағат бұрын

    Hello .u ave used double inverted commas while around something u have used single comma .why plz explain madam .thanx

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

    Does it still make sense for learning particular coding skills at the current era of ChatGPT? We can use plugins in ChatGPT Plus, for example, python, code copilot, data analyst, etc., that help us program with only plain language. Perhaps there is some weakness for the AI generated codes? Maybe we need to dig deeper into the theoretical parts of programming!

  • @ascoolasariv6969

    @ascoolasariv6969

    29 күн бұрын

    AI still generates faulty & improper codes. I have also just started learning Python. My software engineer friend told me in simple words that AI cant just make a whole program. It can help you generate certain codes which will increase your productivity and save a lot of time! But you still have to proof-read the code and correct it! So, basically you need to know the language (till now)!

  • @ellyakello326

    @ellyakello326

    5 күн бұрын

    How do you think chatgpt came to be? It didn't code itself. Principles matter, otherwise you'll be the robot you're trying to create

  • @weishanlei8682

    @weishanlei8682

    5 күн бұрын

    @@ellyakello326 I disagree the opinion. For example, I don't think you understand how to calculate sqrt(2) by hand. You only calculate sqrt (2) by a calculator. Does it make you like a calculator robot by doing this?

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

    The video too often focuses on the teacher. In class I would be focusing on the projected material, not the teacher. It's really annoying that the camera follows the teacher. Often, even when she is pointing at the screen, the part of the screen she points at cannot be seen or isn't in focus. It would improve the course by an order of magnitude if you fixed this.

  • @frankstudent

    @frankstudent

    Ай бұрын

    Agreed

  • @westnash

    @westnash

    28 күн бұрын

    Totally agree and this is a common problem on YT that makes it much less useful for learning than it could be. If the presenter is to be the focus, then the material should be included in notes to the video that we can access and copy or a link provided to them on the web.

  • @MoJoeShoMo

    @MoJoeShoMo

    12 күн бұрын

    This isn't rocket science. This is the very basic stuff. Once you have a debugger, a book on the language, it's all self teaching. In no time this just becomes understood and you're more concerned with what you use programming to accomplish.

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

    I am trying to figure out what Ana's accent is? I am waffling between Canadian (but that is not quite correct) or some other language she spoke when very young then learned English? (but that may not be quite right either). Does anyone have any guesses?

  • @herbertsusmann986

    @herbertsusmann986

    29 күн бұрын

    After further thought I am zeroing in on a west coast Canadian accent. She doesnt seem to have the eastern "aboot" accent but I think in western Canada they dont have that pronunciation.

  • @pjm3005
    @pjm300523 күн бұрын

    just like in my college class, the teacher harps and harps about good variable names and then, inevitably, every piece of example code consists of utterly trash variable names. At 5:38, would it kill you to rename a and z to personOne and personTwo or some such? Same with b, c and d. I'm ok with silly.

  • @lonely_astronaut_
    @lonely_astronaut_16 күн бұрын

    audio sync issues :(

  • @mitocw

    @mitocw

    15 күн бұрын

    We doublechecked the audio and the sync is fine. You will need to troubleshoot your computer/phone/tv setup.

  • @n4mlss

    @n4mlss

    11 күн бұрын

    @@mitocw It starts at 24:10 and ends at 41:05. Video and audio is out of sync, but it's not a big deal.

  • @mitocw

    @mitocw

    8 күн бұрын

    You are correct! Thanks for the time stamps, that helps us a lot!

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

    Or just relay on your teacher

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

    Here again video 2 April 26 2024

  • @khudaijakousar8930
    @khudaijakousar893019 күн бұрын

    Writing Looking blur

  • @user-ye7ej9js6u
    @user-ye7ej9js6uАй бұрын

    What in the actual fuck did u just say

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

    print(((question+' ')*5).rstrip())