Python for Beginners - Learn Python in 1 Hour

Sdílet
Vložit
  • čas přidán 4. 05. 2024
  • Learn Python basics in 1 hour! ⚡ This beginner-friendly tutorial will get you coding fast.
    🚀 Want to dive deeper?
    - Check out my Python mastery course: bit.ly/35BLHHP
    - Subscribe for more Python tutorials like this: goo.gl/6PYaGF
    📕 Get the FREE goodies:
    - Python cheat sheet: bit.ly/2Gp80s6
    - Python exercises for beginners: goo.gl/1XnQB1
    ✋ Stay connected:
    - Twitter: / moshhamedani
    - Facebook: / programmingwithmosh
    - Instagram: / codewithmosh.official
    - LinkedIn: / codewithmosh
    ⭐ My favorite Python books
    - Python Crash Course: amzn.to/2GqMdjG
    - Automate the Boring Stuff with Python: amzn.to/2N71d6S
    - A Smarter Way to Learn Python: amzn.to/2UZa6lE
    - Machine Learning for Absolute Beginners: amzn.to/2Gs0koL
    - Hands-on Machine Learning with scikit-learn and TensorFlow: amzn.to/2IdUuJy
    📖 TABLE OF CONTENT
    0:00:00 Introduction
    0:00:30 What You Can Do With Python
    0:01:15 Your First Python Program
    0:05:30 Variables
    0:09:08 Receiving Input
    0:10:48 Type Conversion
    0:18:49 Strings
    0:23:41 Arithmetic Operators
    0:25:59 Operator Precedence
    0:27:11 Comparison Operators
    0:28:52 Logical Operators
    0:31:06 If Statements
    0:36:16 Exercise
    0:41:42 While Loops
    0:45:11 Lists
    0:48:47 List Methods
    0:52:16 For Loops
    0:54:54 The range() Function
    0:57:43 Tuples
    #Python #AI #MachineLearning #WebDevelopment

Komentáře • 20K

  • @programmingwithmosh
    @programmingwithmosh  Před 2 lety +806

    🔥 Want to master Python? Get my complete Python course: bit.ly/35BLHHP
    👍 Subscribe for more Python tutorials like this: goo.gl/6PYaGF

    • @magombedzeelizabeth7411
      @magombedzeelizabeth7411 Před rokem +12

      Hey Mosh I can't find the method to change my string into an upper case... Its as if the method course. Upper is unavailable. Help please

    • @kamichavez6203
      @kamichavez6203 Před rokem +4

      when I first opened pycharm It did not show me the options to choose the general setting. now when I type in the first code nothing is highlighted and when I run it, all it says is Hi pycharm :'(

    • @yilikalafework
      @yilikalafework Před rokem +3

      why my pycharm defaultly create a main.py file

    • @Fameexpo
      @Fameexpo Před rokem +1

      Hi sir
      I learn python

    • @raynkata_7014
      @raynkata_7014 Před rokem +5

      Thank you very much for the tutorial.
      Could you please update the link for the Python cheat sheet? The current one is not working

  • @codingmadeclear2229
    @codingmadeclear2229 Před 3 lety +21134

    This guy, sat for 1 hour and talked about python, and then released it for free. legend

    • @Hi_its_me_Shruti
      @Hi_its_me_Shruti Před 3 lety +212

      Is it really worth for beginners ?

    • @codingmadeclear2229
      @codingmadeclear2229 Před 3 lety +404

      @@Hi_its_me_Shruti Yeah I think its an great course for beginners tbh

    • @pragmaticai
      @pragmaticai Před 3 lety +22

      Here is another video called Python in One Hour published a few months before this one enjoy! czcams.com/video/ie-hjFXlxTs/video.html

    • @kirtanpatelium3065
      @kirtanpatelium3065 Před 3 lety +102

      @@codingmadeclear2229 true lots of knowledge for the beginners that have no idea🙏🏼

    • @salah1x
      @salah1x Před 2 lety +285

      With 1.3M views, he made around 6,000 USD and counting. No one does anything for free

  • @Seraphvonteschen
    @Seraphvonteschen Před 3 lety +22982

    I'm learning because i want a better job than driving a school bus.
    For many who keep asking, I did infact become a computer programmer. I started here learning Python. Then I moved to others like Java and c sharp and plus plus to name a few. I even learned Fortran because of a job needed it(very useful but not at the same time, lol). I've turned a page from working with a company and decided to design games a long time dream of mine. I hope wholeheartedly that this video helps all of you the same way it did for me. Thank you all for the best wishes. They've helped me push along even when I felt I could go any further. You all are the best!

    • @CodingPerspective
      @CodingPerspective Před 3 lety +822

      You can improve your coding skill with our videos

    • @toughcookie250
      @toughcookie250 Před 3 lety +1077

      Absolutely amazing, you will be rewarded for your hard work, never give up and keep pushing forward!

    • @massrdmdoer7348
      @massrdmdoer7348 Před 3 lety +318

      good for you man

    • @enjoybas
      @enjoybas Před 3 lety +289

      wish you good luck. God bless you.

    • @madhatter2687
      @madhatter2687 Před 3 lety +570

      Let me start off by saying that you have made the first step to be what you want to be. You have already self analyzed and absolutely know you are better than a bus driver. You just did this because you got the opportunity to learn how to be abus driver. Now you have the opportunity to learn how to become more technologically advanced and get smarter at the same time. I have taken this step as well. Let’s start this journey and possibly share our experiences through chat. You can become my chat friend and push one another to be who we were truly destined to be.

  • @Taglioz
    @Taglioz Před 2 měsíci +131

    Thank you so much for the help Mosh!
    Excercise 1:
    print ("Check In")
    print("Data=")
    first_name = "John Smith"
    age = 20
    new_patient = True
    print("Name:",first_name)
    print("Age:",age,"Years Old")
    print("New Patient?","Yes")
    Excercise 2:
    first = input("First: ")
    second = input("Second: ")
    sum = float(first) + float(second)
    strsum = str(sum)
    print("Sum: " + strsum)
    if statements:
    temperature = 25
    if temperature > 30:
    print("It's a Hot Day")
    print("Drink plenty of water")
    elif temperature > 20: # (20, 30]
    print("It's a Nice Day")
    elif temperature > 10: # (10, 20]
    print("It's a bit cold")
    else:
    print("It's Cold")
    print("Done")
    Excercise 3:
    weight = input("Weight: ")
    unit = input ("(K)g or (L)bs: ")
    if unit.upper() == "L":
    weightk = float(weight)/2.205
    print("Weight in Kg: " + str(int(weightk)) + " kg") # (lbs to kg]
    elif unit.upper() == "K":
    weightl = float(weight)*2.205
    print("Weigth in Lbs: " + str(int(weightl))+ " lbs") # (kg to lbs]

    • @blengblong01712
      @blengblong01712 Před měsícem +5

      I'm wondering why (if unit == "K" or "k") doesn't work

    • @artgus1356
      @artgus1356 Před měsícem +3

      @@blengblong01712 Hi man, are you putting the if and unit function inside the ()?? if so, will not work, it has to identify the if and the unit as two different things

    • @blengblong01712
      @blengblong01712 Před měsícem

      ​@@artgus1356 No, I just wrote it inside () to separate it on the sentence. The code works but not the same as the original comment's code, which is my goal

    • @blengblong01712
      @blengblong01712 Před měsícem +2

      @@artgus1356 I wrote it like this
      wt = float(input("Weight: "))
      # Choose Kg or Lbs
      unit = input("(K)g or (L)bs:")
      if unit == ("K" or "k"):
      print("Weight in Pounds: ", wt * 2.205)
      elif unit == ("L" or "l") :
      print("Weight in Kilogram: ", wt / 2.205)

    • @rosswo834
      @rosswo834 Před měsícem

      Theres small mistake on the first exercise, on the bool

  • @shahabuddin126
    @shahabuddin126 Před 2 měsíci +8

    I have been trying to learn. But the way he has explained so far is super easy and understandable. I wish I could come to this channel earlier.

  • @tharmaraj86
    @tharmaraj86 Před 5 měsíci +974

    Three years ago, I viewed this video,and now,I hold the position of Sr.Python developer. Gratitude to Mosh for the guidance.

    • @Ndujlz
      @Ndujlz Před 3 měsíci +12

      congratulations!

    • @ots9358
      @ots9358 Před 3 měsíci +7

      Mentor me please!

    • @iyaiya9819
      @iyaiya9819 Před 3 měsíci

      @@ots9358me too please 🙏

    • @sparkdrive2900
      @sparkdrive2900 Před 3 měsíci +15

      Good job, my little indian friend

    • @antanette1505
      @antanette1505 Před 3 měsíci +9

      Im encouraged by this post

  • @jonathanh8298
    @jonathanh8298 Před rokem +5266

    For those who are struggling to learn Python, like I did, here is a game changing tip:
    avoid long complicated tutorials you see online. You need to walk before you can run.
    Start with very basic Books. Once you get them right, learning everything else becomes much easier.
    Edit: For those asking about the books, the best basic one is Javascript In Less than 50 Pages.
    It`s about Javascript but it is the fastest to learn the conceps that will be useful in any programming language.
    Second I would recommend A Smarter Way to Learn Python. Your knowledge will transform.

    • @helpanimals-
      @helpanimals- Před rokem +69

      Thanks for your input. I have zero computer science experience and struggle with understanding when to use brackets, colons , quotation marks etc. which usually nobody explains in videos, then I wonder why my code doesn't work and take forever to fix it

    • @nhanaquamijr2650
      @nhanaquamijr2650 Před rokem +12

      How can l get the JavaScript book

    • @waddo777dlc2
      @waddo777dlc2 Před rokem +4

      @@nhanaquamijr2650 same question here

    • @jothain
      @jothain Před rokem +38

      Sorry but I'm not going to buy a book for just one "it's game changer" comment. Any good resources that are actually free for the curious?

    • @rsukut5866
      @rsukut5866 Před rokem +15

      This is so true! I struggled with both basic programming and math. Reading the very simplest form and learning the least complex items upfront was SO useful.
      Do that first, then visit youtube tutorials- you'll see an immense difference.

  • @user-nf8uh6vg5c
    @user-nf8uh6vg5c Před 3 měsíci +2

    Outstanding instruction. I have watched a few tutorials from other instructors and your pace and manner of explanation is incredibly effective. I will be taking your courses in the future. Best, J

  • @ilyahohenstein692
    @ilyahohenstein692 Před měsícem +2

    this was very useful. I got stuck at 50% on a python course, and found this to be very helpful to go over everything I had seen on that class from a different angle. The way you talk goes more at the speed that I can process information. I will be watching the 6hr full python course for beginners to cement all this info.

  • @meilinfjellstad7168
    @meilinfjellstad7168 Před 10 měsíci +2480

    Thanks Mosh! ❤ After struggling for 1 year with complicated tutorials, I finally learned Javascript and Python! I did with the help of your videos and a few good books. I got hired this week and I'm here to say thank you!
    Edit: For those asking, I learned with the books 'Javascript In Less than 50 pages' for the basics of programming and 'Smarter Way to Learn Python" to develop my knowledge on Python.
    Learning anything else becomes much easier after that.

    • @Phoneography_adventures
      @Phoneography_adventures Před 10 měsíci +5

      Plz tell me the name of those books.❤

    • @meilinfjellstad7168
      @meilinfjellstad7168 Před 10 měsíci +25

      @@Phoneography_adventures the books are 'Javascript In Less than 50 pages' for the basics of programming and 'Smarter Way to Learn Python" for Python

    • @williamsusa5067
      @williamsusa5067 Před 10 měsíci +36

      5 min in this video and I figured it is too much for a complete beginner like me and had to find a slower way to take in this information. After reading your comment I was compelled to look up the book you mentioned "Javascript in less than 50 pages," and after purchasing I must say, I haven't ever been this excited to learn anything in my life. Thank you!

    • @user-og8di9iq9f
      @user-og8di9iq9f Před 10 měsíci +2

      30:22 got a quick question. in my pycharm it shows the answer is false whereas in Mosh's pycharm it shows true. IS there something wrong with my pycharm?

    • @boismaytkarol8915
      @boismaytkarol8915 Před 10 měsíci

      ​@@williamsusa5067 e

  • @everestdennis4792
    @everestdennis4792 Před 2 lety +2748

    I'm literally only like 5 minutes in and this is making more sense then my weeks of classes. Sir you are amazing. You need to win some sort of award for the service you are doing for the millions of people watching. You are opening doors and potential futures for people. This could be life changing. You gained a subscriber.

    • @prodgers71
      @prodgers71 Před 2 lety +20

      I 100% agree!!!!

    • @shnitsel
      @shnitsel Před 2 lety +24

      @@prodgers71 me too!
      five minutes in i made a 10 line code for myself!!
      everything i knew was variables and the print function.
      that's it.

    • @sarthak7708
      @sarthak7708 Před 2 lety +18

      YAH BRO THIS GUYS TOTAL LEGEND MAKES IT TOO EASY he won in best tech youtuber 2021 he deserved man sat for ove 1 hour or maybe more and uploads it for free i watch every of his full to pay off hardwork.

    • @MichaelPlayz_
      @MichaelPlayz_ Před 2 lety +1

      he made another subscriber

    • @ugonnaubaka5048
      @ugonnaubaka5048 Před 2 lety +3

      He’s too good tbh,
      A gem

  • @wiiori4618
    @wiiori4618 Před 2 měsíci +2

    I learned so much in one hour and actually did all the examples. Great content.

  • @user-xc9fn8cz4x
    @user-xc9fn8cz4x Před 2 měsíci +12

    Mosh you trully are an amazing teacher
    anyway this is my answer to ex3
    weight= int(input("Weight: "))
    unit= input("(K)g or (L)bs: ")
    if 'k' in unit or 'K' in unit:
    converted = weight / 0.45
    print("Weight in Lbs: " + str(converted))
    elif 'l' in unit or 'L' in unit:
    converted = weight * 0.45
    print("Weight in kgs: " + str(converted))

    • @leonaise7546
      @leonaise7546 Před 4 dny

      Thank you bro! I had the same answer as you but I said “else if” instead of “elif”. That’s why my code didn’t work! Thanks for helping me!

  • @matthewrennie1110
    @matthewrennie1110 Před 3 měsíci +153

    I’ve been doing python classes for 4 weeks now and your 1 hour has taught me more than going to class for 4 hours

  • @WingZeroType
    @WingZeroType Před měsícem

    Thanks for this. Getting back into coding after almost a decade away and this was a great way to be introduced to the syntax of a new language

  • @try2060
    @try2060 Před 2 měsíci +1

    for the weight exercise. i came up with this. even though it is different it works
    weight = float(input("weight: "))
    metric = input("Kg or Lb: ")
    if bool('k'):
    kilo = int((weight / 2.02))
    print(kilo)
    elif bool('l'):
    pound = int(weight * float(2.02))
    print(pound)

  • @Proche27
    @Proche27 Před 7 měsíci +518

    Ik he won’t see this, but this was such a clear display of how to understand the language at a base. Felt like my class expected us to juggle so much info at once without going over the basic lessons again. This is exactly what I needed as a refresher so thanks

  • @yiwantao9622
    @yiwantao9622 Před 6 měsíci +466

    0:00:00 Introduction
    0:00:30 What You Can Do With Python
    0:01:15 Your First Python Program
    0:05:30 Variables
    0:09:08 Receiving Input
    0:10:48 Type Conversion
    0:18:49 Strings
    0:23:41 Arithmetic Operators
    0:25:59 Operator Precedence
    0:27:11 Comparison Operators
    0:28:52 Logical Operators
    0:31:06 If Statements
    0:36:16 Exercise
    0:41:42 While Loops
    0:45:11 Lists
    0:48:47 List Methods
    0:52:16 For Loops
    0:54:54 The range() Function
    0:57:43 Tuples

  • @benjecklin7806
    @benjecklin7806 Před měsícem +3

    Im totally new to python. I have watched many videos and all seemed good, but after this one I actually feel like I learned something. Awesome thank you

  • @tee-yup
    @tee-yup Před 3 měsíci

    for a long ass time now ive been trying to understand programming but just havent gotten far in it whatsoever; a lot of other beginner "tutorials" just don't go deep enough into exactly what all this jargon that's completely new to me meant. my brain clicked right into place with this one, though. seeing the += assignment operator in use after actually learning what each component meant rather than them just being used by these creators that probably see it as second nature atp just blew my mind. epic freaking video

  • @Drt0Kkdo
    @Drt0Kkdo Před 2 lety +340

    You're like one of those good teachers that lead your students towards a mistake to teach them what and how something could go wrong then, teach how to do it properly. Loving this.

    • @bryantaylor683
      @bryantaylor683 Před rokem +4

      The first time he did it, I didn't unpause, tried to alter it, and made more code trying. Eventually unpaused frustrated, and was honestly happy it went like that after the explanation, it's gonna stick a lot better now because of that.

  • @et2608
    @et2608 Před 3 lety +249

    I love how every time he says "Let me show you" it's unlike any other teacher trying to explain anything - he does such an good job!

    • @arkkingom8191
      @arkkingom8191 Před 2 lety +3

      Teachers are useless at explaining but not all of them

  • @CombatChief0126
    @CombatChief0126 Před měsícem +7

    Ex #2
    type = input('Is your calculation dealing with whole numbers?')
    if type.lower() == 'yes':
    first = input('What is your first number?')
    second = input('What is your second number?')
    sum = int(first) + int(second)
    print('The sum of your equation is,', sum,"!")
    elif type.lower() == 'no':
    First = input('What is your first number?')
    Second = input("What is your second number?")
    Sum = float(First) + float(Second)
    print('The sum of your equation is,',Sum, "!" )
    else:
    print("Huh? please input 'yes' or 'no' 🤗")

  • @nadiuhh98
    @nadiuhh98 Před 15 dny

    i have a midterm next week and this covers everything we've learned in class so far! currently studying along at home w my flashcards. i really liked the "remote" analogy, the way you explain error messages and what data types can and cant do! thank you so much!

  • @paulcantshutup
    @paulcantshutup Před 2 lety +663

    Now THIS is superlative instruction; teach a concept, and then demonstrate it. That you include errors is a stroke of genius! The nuances of programming languages can be difficult to understand at first, but by showing things going WRONG, you also show how to CORRECT the mistakes. This is just brilliant work. Thank you! Subscribed as hell!

    • @Linkolite
      @Linkolite Před rokem +6

      Dude as I was reading this it happened! That’s a really nice touch, great education technique

    • @trspanda2157
      @trspanda2157 Před rokem +6

      Jesus loves us all that's why he died for our sins.

    • @barknburcu5766
      @barknburcu5766 Před rokem +1

      @@trspanda2157 fake

    • @Daniel-oc2mu
      @Daniel-oc2mu Před rokem

      @@barknburcu5766 wake up before it gets too late. Don't find yourself in hell later, while ignoring this message.

    • @barknburcu5766
      @barknburcu5766 Před rokem +1

      @@Daniel-oc2mu what?

  • @claydice1315
    @claydice1315 Před 6 měsíci +135

    I’m 32 years old. Father of 3. Dead end job after dead end job. Finally sat down with my wife and talked about what I’d like to do in life. Everything I said centered around technology and I really like the idea of coding/programming. Decided I’m going to see if I can learn it and if I can I will learn it and apply it and start a career. Thank you for this.

    • @krishnamohanm8569
      @krishnamohanm8569 Před 6 měsíci +4

      good luck brother.

    • @zombiebotnet343
      @zombiebotnet343 Před 6 měsíci +2

      good luck man

    • @claydice1315
      @claydice1315 Před 6 měsíci

      @@zombiebotnet343 thank y’all. I downloaded python (pycharm) last night. And today I’ve been doing some free courses online to learn it. I’m literally starting at zero but I can already tell I really enjoy this. I know this sounds corny but I made a triangle last night lol. And was so excited that I made a triangle out of computer code.

    • @Gorilla69
      @Gorilla69 Před 6 měsíci +1

      I've heard of people getting out of dead-end jobs just because of this mentality combined with Python before, allthewhile increasing their pay massively. Definitively possible :)

    • @MoonyFeathers
      @MoonyFeathers Před 6 měsíci

      Did the video work?

  • @magicgaming1715
    @magicgaming1715 Před 2 měsíci +5

    Ans of the second exercise
    weight = int(input("Weight = "))
    weight_in = input("(K/k)for KG or (P/p) for pound = ")
    if weight_in =="k" :
    out_weight = weight * 2.20462
    weight1 = round(out_weight, 3)
    print("The weight in Pound = ", weight1)
    elif weight_in =="K" :
    out_weight = weight * 2.20462
    weight1 = round(out_weight, 3)
    print("The weight in Pound = ", weight1)
    elif weight_in =="p" :
    out_weight = weight / 2.20462
    weight1 = round(out_weight, 3)
    print("The weight in kg = ", weight1)
    elif weight_in =="P" :
    out_weight = weight /2.20462
    weight1 = round(out_weight , 3)
    Your video was very help full.
    I passed my grade 8 finals because of you.

    • @The_Haunter
      @The_Haunter Před 2 měsíci

      Thanks for letting me double check, but the code could be smaller or simpler, with a very small google search to help with the lower case, though one could replace it instead with just CAPATALISE.
      weight = float(input("Weight: "))
      unit = input("(K)g or (L)bs: ")
      if unit.casefold() == "k":
      weight = float(weight) * 2.205
      print("Weight in Lbs = " + str(weight))
      else:
      weight = float(weight) / 2.205
      print("Weight in Kg = " + str(weight))
      Edit: I just realised that he also covered the answer in the video, so my comment is kinda pointless. But oh well, I got to share my answer though so that's a plus.

    • @rjewi1671
      @rjewi1671 Před měsícem

      🎉

  • @platoschauvet
    @platoschauvet Před 2 měsíci

    Very helpful, thank you! Wonderful to see great videos like this with some many deserved views 😊.

  • @bksanpvlog
    @bksanpvlog Před 8 měsíci +427

    9:07 Exercise
    P_Name ="john Smith"
    P_age =20
    P_admit="New"
    print (P_Name ,P_age,p_admit)
    _________
    14:56 Exercise
    First_num=input("Enter Your First Num. ")
    Sec_num=input("Enter Your Sec Num" ")
    Sum =float(first_num+sec_num)
    Print ("sum is =" + sum)
    .....Also that's can by use for - * /
    _______
    18:02 str () function is use For combine the str with floating number
    _______
    In string 18:59 we have same Methods or Function
    Name.find () =find Same Index of char
    Name.uper() lower() =convert char to lower uper
    Name.replace()=replace the Char or String in sentence !
    In keyword =find is that available
    ______
    34:50 endant also called Body or block
    Add comment by #
    ____
    51:00 create A List ....this is Just like array
    Name ["BILAL" , "OSAMA" , "MAAZ"]
    51:10 There are same methods like
    Name.append (ali) =add name is last
    Name.insert (index , value ) =add name any where
    Name.remove(value ) = remove specific value
    Name.clear (list) =clear all list
    (1 in list name ) = is that available
    Len() =length of list
    53:19 for loop
    Syntex
    For data in Listname :
    Print (data)
    ___
    56:00 range(10) = add numbr from 0 to 10 use just these expiration
    Range(0 : 10 : 2) showe after 2 digit like 2 4 6 8

    • @basementcattiger6231
      @basementcattiger6231 Před 7 měsíci +29

      for the first exercise right answer is `is_new = True` , not ' P_admit="New"'

    • @snikiniki7459
      @snikiniki7459 Před 7 měsíci

      ​@@basementcattiger6231yall are slay For doing this omaga

    • @Blender-co6vd
      @Blender-co6vd Před 7 měsíci +11

      @@basementcattiger6231 why? It is up to him what variable he chooses

    • @dedicategrinder88
      @dedicategrinder88 Před 6 měsíci +3

      thanks, had to confirm if got right, no answers :(

    • @onayesabdullah21
      @onayesabdullah21 Před 6 měsíci +2

      thank you

  • @jackcoquillon8975
    @jackcoquillon8975 Před rokem +127

    I'm learning because I'm tired speaking with customers on the phone for 40hrs every week. I almost quite my job today, but I want to have an alternative. Coding is something I've always wanted to learn, so here I am. Thank you for sharing your knowledge

    • @cameronreed4476
      @cameronreed4476 Před rokem +5

      lol right with you man

    • @ahowardcg
      @ahowardcg Před rokem +1

      help desk support for 15 years network support for 2 im freaking over it

    • @pythonez8719
      @pythonez8719 Před rokem +2

      exactly!. working on my videos rt now to get them this good and explained well. feedback is appreciated

    • @geezygaming711
      @geezygaming711 Před rokem

      im in the same boat man! lol

    • @jackcoquillon8975
      @jackcoquillon8975 Před rokem

      @@pythonez8719 preciate you doing that. I'm subscribed

  • @KevTheGalaxybender
    @KevTheGalaxybender Před 2 měsíci +1

    took me 4 days to get through but I did. Now moving on to learning more. Thanks a lot for taking your time to do this.

  • @Stekaren
    @Stekaren Před měsícem +2

    at 15:08 now, this is so fun learning and you're really good at explaining. this is my exercise 2 i would like to share
    /* exercise 2 */
    first_number = input("enter first number: ")
    second_number = input("enter second number: ")
    x = int (first_number)
    y = int(second_number)
    sum = x+y
    print(sum)
    how did i do compared to others? im a total newbie humble to learn python

  • @Marcos-nl7el
    @Marcos-nl7el Před 3 lety +642

    your english is really easy to understand for someone who is not a native speaker, thanks!!

  • @CyberEd24
    @CyberEd24 Před 18 dny

    Hi Mosh! I am learning Python for automation. I just graduated in Cybersecurity and computer networks, and I found your video very helpful! Thanks!

  • @user-ui4jb5pj1i
    @user-ui4jb5pj1i Před 2 měsíci

    I’ve been taking classes at uni and they have failed miserably at teaching this language compared to this tutorial/beginner class. I’ve watched a total of ten minutes so far and feel like I know much more now than I did after watching and reading hours of content from Uni. I highly recommend watching this video if you’re interested in learning Python. Mosh (who is providing the tutorial) speaks in a calm and clean manner which resonates well with audiences. And he also truly explains what he is doing at any given moment.

  • @bigsteppa42
    @bigsteppa42 Před 3 lety +488

    10 minutes in and i already learned more than i did from my high school teacher

  • @UB0NG
    @UB0NG Před 2 lety +833

    As a programming newbie, I can say that this has simplified Python to a point that I am wholly interested. Awesome job, Mosh!!

    • @euroking3941
      @euroking3941 Před 2 lety +4

      Wow ok Virgin

    • @pelomalino9715
      @pelomalino9715 Před 2 lety +22

      @@euroking3941 tf

    • @levimagee2459
      @levimagee2459 Před 2 lety +38

      @@euroking3941 youre the kid with the long hair and sits on the back of the class to only make corny and unfunny remarks about someone's mom and then dont talk for the next month and a half

    • @egg2586
      @egg2586 Před 2 lety +12

      ​@@euroking3941 no need to project your sexual frustration on others

    • @mattjacobson3616
      @mattjacobson3616 Před 2 lety +8

      Im a newbie at this myself. I want to try this but im worried about messing up my PC. If I make a mistake with this program can I harm my PC?

  • @swwiper8965
    @swwiper8965 Před 2 měsíci +3

    I'm in year 9 and chose computer science for my GCSE. I'm trying to learn this early so it makes it easier later on. This was very helpful and I'm understanding most of it thanks to you.

  • @mohsenmomeni007
    @mohsenmomeni007 Před 2 měsíci

    Hi Mr moshfegh am very glad to find you here and see you are a popular teachers on here :)
    and i proud of to you

  • @Linuxfy
    @Linuxfy Před 3 lety +1470

    I just print "Hello World" in the terminal. I'm waiting for an email from Google Software Engineer.

    • @realnice3672
      @realnice3672 Před 3 lety +7

      xd

    • @nevang6314
      @nevang6314 Před 3 lety +75

      you got no chance. i have an input for your age and then prints your age. sorry but im getting in google :)

    • @aryangirijan3008
      @aryangirijan3008 Před 3 lety +4

      Aww

    • @HarryMator
      @HarryMator Před 3 lety +23

      *i remembered the brackets, you have no chance*

    • @aryangirijan3008
      @aryangirijan3008 Před 3 lety +5

      @@HarryMator sad I remember input function not brackets unlike u *no one stands against me now*

  • @morhogeg
    @morhogeg Před 3 lety +605

    Mosh is the best programming teacher on CZcams!❤

    • @hardeepkanaujia
      @hardeepkanaujia Před 3 lety +16

      @@programmingwithmosh yes sir, you are my guru

    • @lokrajkoundal4175
      @lokrajkoundal4175 Před 3 lety +6

      @@programmingwithmosh sir , I was waiting for this only thanks but I saw the previous too. 2020 pythan

    • @sulemantasawar3265
      @sulemantasawar3265 Před 3 lety +2

      I also agree with you

    • @neilyang2957
      @neilyang2957 Před 3 lety +4

      Me think Mosh is the best programmer teacher 👨‍🏫 too

    • @narendirank7501
      @narendirank7501 Před 3 lety +11

      @@neilyang2957 Absolutely. Mosh is the best. I am just 11 but now I know HTML,CSS, JavaScript,python because of Mosh😀

  • @theuglysweatr3628
    @theuglysweatr3628 Před měsícem +6

    tysm ... im 12 so i don't really understand a lot of coding tutorials but i always had a passion for coding with this tutorial i learnt more about python

    • @respect-ym2os
      @respect-ym2os Před 6 dny

      Same I m 12 too and I really want to learn it and I want to be a good hacker 😅😊

  • @user-qo2cp4kf9g
    @user-qo2cp4kf9g Před 3 měsíci +3

    20 seconds in and i already like you

  • @ArnavBoom
    @ArnavBoom Před rokem +228

    8:49
    Patient_Name = "John Smith"
    Patient_age = 20
    is_new = True
    print(Patient_Name, Patient_age, is_new)
    15:00
    First_Number = input("First: ")
    Second_Number = input("Second: ")
    Final_Number = float(First_Number) + float(Second_Number)
    print("Sum: " + str(Final_Number))

    • @18782.
      @18782. Před rokem +5

      thanks

    • @tomhartley5086
      @tomhartley5086 Před rokem +5

      I did this
      first = int (input ("First Number"))
      second = int (input ("Second Number"))
      print(first + second)

    • @tomhartley5086
      @tomhartley5086 Před rokem +4

      first = float (input ("First Number"))
      second = float (input ("Second Number"))
      print(first + second)
      is better :)

    • @DonnyDiamondd
      @DonnyDiamondd Před rokem +8

      I made this:
      first_name = "John"
      second_name = "Smith"
      age = 20
      New_Patient = True

    • @PeaceNinja007
      @PeaceNinja007 Před rokem +5

      I don’t know how I did it but it worked for me when I did this:
      Line 1: sum = int(20) + float(10.1)
      Like 2: print(sum)
      I ran it and it just shows 30.1.
      Is this technically correct? Why does it have to have input first, and second .. and all that extra stuff?

  • @sethsilber6889
    @sethsilber6889 Před 3 lety +713

    I'm learning so I can teach my sister so she can pass her class.

  • @harshakalluri4455
    @harshakalluri4455 Před 2 měsíci +1

    After a year search of python courses as I am not from tech background...this is the first video i completed and understood...omg thanks a lot...I will redo this video course like 2-3 times and then go for the full course

    • @dmcstudio
      @dmcstudio Před 8 dny

      I"m still in the not understanding category lol

  • @IndianJalpariHere
    @IndianJalpariHere Před 27 dny +1

    Thank you for such a great class! so precise and easy to follow. Grateful for teachers like you Mosh :)

  • @behindthebros3248
    @behindthebros3248 Před rokem +32

    I started my first in-person university computing class last week, having only previously done a month of education in computing during eleventh grade. This video was extremely helpful in getting me caught up to where I need to be to succeed in my class.

  • @513RR4
    @513RR4 Před 7 měsíci +157

    I am a Big Picture high school student, and I am studying to be a game developer using Python. I was told to learn the basics first, I already knew a good bunch of the basic but still needed to learn, I found some websites and videos, but nothing was as good as this video. Even if it is 2 years old, it still helped a lot. It didn't take me an hour though, I was taking notes, I was coding at the same time he did, I was pausing and rewatching pieces and I rewatched the video more than once. This 1 hour video turned into 2 weeks for me. Worth it. Thanks a lot Mosh.

    • @martinmcnulty8155
      @martinmcnulty8155 Před 7 měsíci +6

      Still a long way to go before becoming a game developer but knowing the basics is definitely necessary.

    • @mitsu1625
      @mitsu1625 Před 7 měsíci +3

      keep it up

    • @MK-ib8ch
      @MK-ib8ch Před 3 měsíci

      How's it going? I'm doing the same mind sharing your contact

    • @torivega017
      @torivega017 Před 2 měsíci

      you should try taking up c++, if im not mistaken, game developments use c++ more rather than Python. For example, Unreal Game Engine uses c++

    • @luckyluck9259
      @luckyluck9259 Před 4 dny

      So cool I'm doing the same thing- first I watch one part of the video to process it mentally, then I watch it for the second time and write notes in Word and then I watch it for the third time and actually try it out once I understand how it works. And then I do the practice part by myself👍

  • @viplavgangawane4395
    @viplavgangawane4395 Před měsícem

    This is just perfect. Not so fast not so slow. Covered every scenario. Just too good

  • @9Vivaan_Juwarkar
    @9Vivaan_Juwarkar Před měsícem +3

    Solution of exercise
    8:50
    name = 'John Smith'
    age = 20
    is_new = True
    14:50
    first = input("First: ")
    second = input("Second: ")
    sum = float(first) + float(second)
    print('Sum: ' + str(sum))
    36:16
    weight = float(input("Weight: "))
    unit = input("(K)g or (L)bs: ")
    if unit.lower() == "k":
    print("Weight in Lbs: " + str(weight * 2.2))
    if unit.lower() == "l":
    print("Weight in Kg: " + str(weight / 2.2))

  • @MetalMageArt
    @MetalMageArt Před rokem +471

    My tiny brain can't comprehend how you crammed so much information into such a short timespan and still made it easily understandable. Thank you so much for this tutorial and I hope this will be the start of a coding passion for me.

    • @manoranjanbiruli2789
      @manoranjanbiruli2789 Před rokem

      But ur a chicken

    • @toastbadoinks7448
      @toastbadoinks7448 Před rokem

      I'd recommend this video. Its fire🔥czcams.com/video/bd4ENYV5HWY/video.html

    • @abiodunaghedo550
      @abiodunaghedo550 Před rokem +5

      It is not necessary to learn so much in your day that your brain feels like it has too much information stored inside it and it is going to explode😵‍💫😬🤢. Like numbers are infinitive you should stop at the numbers your brain can take😌.

    • @cgx7089
      @cgx7089 Před rokem +3

      teachers would make it so complicated

    • @RobertSpiller
      @RobertSpiller Před rokem +2

      Take it in bite size chunks...Learn mind mapping to help you learn and remember ideas and concepts. Take your time, and just affirm constantly that you can and will do this.

  • @barrackroy9776
    @barrackroy9776 Před 2 lety +77

    Mehn I've been a lazy programming student but I just can't stop learning with your videos, so straight forward . thanks Mosh

  • @mikehamoudi8629
    @mikehamoudi8629 Před 2 měsíci

    man i have learned in this hour video what i could not learn for a year else where. the way he explained things make it so fun to do.

  • @jayasubha96
    @jayasubha96 Před 2 měsíci

    You made it so simple! Thankyou Mosh!!

  • @vinling2767
    @vinling2767 Před 2 lety +26

    Currently recovering from TBI an struggle with learning conditions. Your videos are better then the digital book at my online school. Thank you for all your efforts.

  • @albolvo
    @albolvo Před rokem +52

    I have decided to learn coding so I can improve my status in life. I'm tired of being a laborer, unskilled and uneducated. Today I take control of my life. Thank you!

    • @TasmanianTigerGrrr
      @TasmanianTigerGrrr Před rokem +5

      Good for you! How is it working for you?

    • @albolvo
      @albolvo Před rokem +14

      @@TasmanianTigerGrrr it's challenging not having a strong technology background. Lots of deep immersion and catching up but I will get there!

    • @oca1253
      @oca1253 Před rokem +1

      How's life going man?

    • @Sucrose__
      @Sucrose__ Před rokem +2

      @@oca1253 it's been 2 weeks, dude

    • @albolvo
      @albolvo Před rokem +1

      @@oca1253 still plugging away, learning as much as I can as fast as I can. You wanna tutor me?

  • @MarisaSiS
    @MarisaSiS Před měsícem

    Thanks for the Python intro! I want to automate pulling data from word file reports and then put that information into an excel tracker - currently my team has to do it manually. I’ll look into your course to see if that will get me there quickly!

  • @builderjake8991
    @builderjake8991 Před 18 dny

    I know my exercise 1 may be simple but it is ultimately what I know right now in Python as I am a new user who is in construction and has only been exploring python for about a few hours now. Thank you for your time doing this tutorial!
    print("Welcome to BFU Hospital Check-in")
    print(input("What is Patient's Name?"))
    print(input("What is Patients Age?"))
    print(input("New patient Y/N?"))

  • @sacthus
    @sacthus Před 3 lety +656

    Just made my own calculator that can only do addition, now I am waiting for a response from Google to see if they will hire me.

    • @peanutandginger5358
      @peanutandginger5358 Před 3 lety +9

      looooool!! Genius!

    • @Tiger_Labs_Code
      @Tiger_Labs_Code Před 2 lety +19

      I made a Calculator that can add, subtract, multiply and divide=)

    • @juinaik8038
      @juinaik8038 Před 2 lety +2

      Lol

    • @rishithab6051
      @rishithab6051 Před 2 lety +4

      @@Tiger_Labs_Code great by seeing this video did u made it

    • @kyuwoo.
      @kyuwoo. Před 2 lety +8

      @@Tiger_Labs_Code Same, but I was too lazy to add them all into the same program via if else statements, so i just made separate programs for each.

  • @margarethsanchez9102
    @margarethsanchez9102 Před rokem +71

    8:55
    name = "John Smith"
    age = 20
    type = "New patient"
    print(name, age, type)
    15:07
    a= input ("First: ")
    b = input("Second: ")
    c = float(a) + float(b)
    print("Sum: " + str(c))

    • @Eleventyeleventh
      @Eleventyeleventh Před 11 měsíci +2

      Mind if I copy your homework?

    • @KevinLin45
      @KevinLin45 Před 11 měsíci +2

      @@Eleventyeleventh do it yourself dude.

    • @woolzem
      @woolzem Před 11 měsíci +2

      Thank you ❤ day one learning

    • @peterchoiii
      @peterchoiii Před 11 měsíci

      a = input("First: ")
      b = input("Second: ")
      sum = float(a) + int(b)
      print("Sum = " + str(sum))

    • @rima1661
      @rima1661 Před 9 měsíci

      is it ok if i wrote it like this?
      first = input("Enter number")
      second =input("Enter number")
      instead of
      first = input("First: ")
      second = input("Second: ")

  • @jadenwright4489
    @jadenwright4489 Před 11 dny +1

    my answer to exercise 3 for anyone wondering how to do it.
    weight = float(input("Weight: "))
    question = input("(K)g or (L)bs: ")
    if question.upper() == "K":
    answer = weight / 0.45
    print("The weight is " + str(answer))
    if question.upper() == "L":
    answer = weight * 0.45
    print("The weight is " + str(answer))

  • @codyjacobson7975
    @codyjacobson7975 Před 29 dny

    Man! That took a huge leap at "If Statements". This is my first experience with coding. Gunna need a bunch more experiences. Coming back for "While Statements" tomorrow after Wrestlemania.

  • @Akhan4u
    @Akhan4u Před 2 lety +58

    Excellent Course. No distraction, No crap. Just explained with so much ease and comfort. Makes so much sense for every minute of the hour!!!

  • @tsetsanakhobotlo4823
    @tsetsanakhobotlo4823 Před 3 měsíci +94

    Just completed this crash course, and I am super grateful to you, Mosh, for explaining these basics in the simplest and most interesting way ever. Thank you. You have gained a follower from the mountain Kingdom of Lesotho.

  • @artgus1356
    @artgus1356 Před 15 dny +1

    This video motivated me to start in Python and programming itself! Thank you for the video, being direct and clear, it makes people feel like they are really understanding and improving in something like this! I will continue studying/practicing for sure, thank you very much!

  • @satoshiketchum9111
    @satoshiketchum9111 Před 2 měsíci

    36:12
    weight=float(input("Weight: "))
    measurement=input("(K)g or (L)bs: ")
    if measurement=="k" or measurement=="K":
    conversion=round(float(weight/ 2.205),2)
    print("weight in Lbs: ",str(conversion),"Lbs")
    elif measurement=="l" or measurement=="L":
    conversion=weight*2.205
    print("weight in Kg: ",str(conversion),"Kg")

  • @ZAH33D
    @ZAH33D Před rokem +71

    Gonna keep adding things here.
    9:00
    first_name = "John"
    last_name = "Smith"
    patient_age = 20
    patient_admission = "New patient"
    print (first_name, last_name)
    print (patient_age)
    print (patient_admission)
    Result-
    John Smith
    20
    New patient
    10:45
    name = input ("What's your name? ")
    print (name +" mama")
    Result-
    What's your name? Joe
    Joe mama
    15:05
    first = input ("First: ")
    second = input("Second: ")
    Sum = int(first) + int(second)
    print("Sum: " + str(Sum))
    Result- worked at 7th try.
    33:40
    Gave me a pretty good idea.
    temperature = float(input("What's the temperature today? "))
    if temperature > 30:
    print("It sure is a hot day.")
    print("Drink plenty of water")
    Result- took a couple of tries, works awesome

    • @CodeNameCheese_
      @CodeNameCheese_ Před rokem +1

      Thanks man this actually helped me correct some of my mistakes

    • @bts1073
      @bts1073 Před rokem

      do u know how to write a code if we have to print the no.of uploads in a certain app within a certain month?

    • @manumedleri1355
      @manumedleri1355 Před rokem

      Tq man 👍

    • @saidit0nc366
      @saidit0nc366 Před rokem

      mashallah, thank you ahki, started learning about three weeks ago and this help a lot.

  • @AG-fl9jx
    @AG-fl9jx Před 3 lety +33

    Mosh explains everything thoroughly and never misses on a single part. He has challenges for us so that we take what we learned in the past and implement it in our code. I am still in the middle of the course but I can say that this channel is the #1 channel for those who want to learn to code! Keep it up!!

  • @mohammadyassin7100
    @mohammadyassin7100 Před 9 dny +1

    w = float(input("wight: "))
    x = input("(K)g or (L)bs ? ")
    if x.upper() == "K" :
    print("your wight in lbs is: ",w * 2.205)
    elif x.upper() == "L" :
    print("your wight in kg is: ",w / 2.205)
    36:40

  • @Ryan-Fkrepublicnz
    @Ryan-Fkrepublicnz Před 2 měsíci

    Now I see why people like Python. The use of lists and Item with a for is SO MUCH EASIER than C++ and Java. Thank whoever did this!

  • @f1memelord72
    @f1memelord72 Před rokem +10

    I am taking GCSE computer science and one of the main tips i got was to learn to code. Watching this one hour tutorial, I have learned more in two hours than I did in 5 lessons of python tutoring at school. Thanks mosh.

  • @kencharles31
    @kencharles31 Před 2 lety +333

    I cant believe i spent up to 2 hours watching and practicing with this tutorial, and i enjoyed it. I love the exercise section, its inspiring. Thanks for taking your time to give this tutorial.

    • @edbergstrom6346
      @edbergstrom6346 Před 2 lety

      Horrible video - outdated and if you really followed this video - then you can't make it past the first 7 minutes - Garbage for those of us that really wanted to learn something.

    • @mrcodfish-hc-
      @mrcodfish-hc- Před 2 lety +6

      No thats not true!!! Why do you say that to a person that take his time to teach other persons how to learn Python?

    • @myko3279
      @myko3279 Před 2 lety +6

      @@edbergstrom6346 why do u say that, 5yo kid?

    • @mfnafanimations
      @mfnafanimations Před 2 lety +3

      @@edbergstrom6346 what no its a really good tutorial actually

    • @thanosnoctem4473
      @thanosnoctem4473 Před 2 lety +13

      @@edbergstrom6346 I watched this video for an hour and it makes much more sense than your existence ever did

  • @Dhini.V.Z
    @Dhini.V.Z Před 8 dny +1

    Anyways heres my answer for those exercises
    Exercise 1:
    Name = John Smith
    Age = 20
    Is_new = True
    print ("The new patient is+age+"years old")
    Exercise 2:
    first = input("input first number here ")
    second = input ("input second number here ")
    sum=float(first)+int(second)
    print(sum)
    i'm still learning

  • @kkucukcelebi
    @kkucukcelebi Před měsícem

    I just discovered this channel and I loved it. Hi Mosh, this is Kerem at Ministry of Coffee ;)

  • @janicelim1039
    @janicelim1039 Před 2 lety +124

    as someone who legit struggled for a few years trying to start learning python, trying to understand and comprehend python because it's too technical, this has made learning python a whole lot more easier and digestible compared to self learning on Kaggle, etc. Thanks a bunch Mosh for making learning feel easier!!

  • @rowanoaks4576
    @rowanoaks4576 Před rokem +129

    I’ve tried lots of different methods to help me learn code, and this video is by and far one of the best resources that has helped solidify some of the more abstract terms related to coding. Absolutely fantastic job.

  • @konstantinossooutlis532
    @konstantinossooutlis532 Před 2 měsíci +1

    Excellent course. Very comprehensive and well explained!

  • @hamdallahsanusi737
    @hamdallahsanusi737 Před 2 lety +85

    I’m a housewife but I also want to do some remote job in IT while caring for my family
    Thanks for this mosh I hope to be a python expert one day

    • @mr.creeper6484
      @mr.creeper6484 Před 2 lety +1

      Good Luck!

    • @Senorpoontang
      @Senorpoontang Před měsícem

      How has your journey been so far? Where are you now in terms of coding?

  • @paramveerssachdeva
    @paramveerssachdeva Před 2 lety +30

    Im hooked Instantaneously for the straightforward no time wasting, and simple explanatory videos. Became a subscriber immediately.

  • @nerokyi
    @nerokyi Před 13 dny

    Thank you for taking your time to help me learn.
    Exercise 1:
    print("Check In:")
    first_name = "John"
    last_name = "Smith"
    age = 20
    new_patient = True
    patient_name = first_name + " " + last_name
    print("Patient Name: ",patient_name)
    print("Age: ",age)
    print("New Patient: ",new_patient)
    Excercise 2:
    First_Num=float(input("First Number: "))
    Second_Num=float(input("Second Number: "))
    Sum=First_Num+Second_Num
    print("Sum: ",Sum)
    Excercise 3:
    weight = int(input("Weight: "))
    unit = input("(K)g or (L)bs: ")
    if unit.upper() == "K":
    converted = weight / 0.45
    print("The Weight in Lbs: ", converted)
    elif unit.upper() == "L":
    converted = weight * 0.45
    print("The Weight in Kgs: " + str(converted))

  • @zoyafatima5345
    @zoyafatima5345 Před 2 měsíci

    I'm learning python for fun cuz I've always been interested in coding for a long time now though being med student. They said it's gonna be difficult for me as I'll be learning it from scratch but I hardly find this difficult and I'm glad I came across this video.

  • @gonzaloalbert3538
    @gonzaloalbert3538 Před rokem +30

    Im here to learn Python because i work in RPA, lowcode so far (Visual Programming, some javascript). After watchin this video I can tell you this is one of the best tutorials ive ever seen. You make it clear, simple and entertaining. Suscribed, now straight to the full course. Thanks man

  • @dcruan6771
    @dcruan6771 Před 8 měsíci +43

    I use to always fail my coding classes, but you make so much more easier! THANKS A LOT!

  • @eng.miroslavmanahilov1730

    41:00 - What about this?:
    u = input("Type lbs for pounds: ")
    w = float(input("Insert your weight: "))
    if u == "lbs":
    print("Weight: " + str(w / 2.2))
    else:
    print("Weight: " + str(w * 2.2))

  • @Niels_Mortensen
    @Niels_Mortensen Před měsícem

    Great video for starting out
    I did the following with the weight assigment:
    pounds = 2.2046
    weight = input("Please enter your weight: ")
    metric = input("(k)g or (l)bs: ")
    if metric.upper() == ("K"):
    sum = float(weight) * pounds
    print(f"Weight in lbs: {sum}")
    elif metric.upper() == ("L"):
    sum = float(weight) / pounds
    print(f"Weight in kg: {sum}")
    else:
    print("Please enter valid input")

    • @blengblong01712
      @blengblong01712 Před měsícem

      Do you know why using
      (if unit == "K" or "k"
      elif unit == "L" or "l")
      doesn't work?

  • @bogdanivascu8970
    @bogdanivascu8970 Před rokem +20

    Proudly presenting my solution to 36:16
    weight = input("What is your weight?" )
    unit = input("is it in kgs or lbs?" )
    if unit == "k":
    convert = float(weight) / 0.4
    print("weight is " + str(convert)+ "lbs")
    else:
    convert = float(weight) * 0.4
    print( "weight is " + str(convert)+ "kgs")
    I feel like a rugged software architect! Sky is the limit 💪! Congrats Mosh, you make no talent whatsoever people like me, feel like software Einsteins!

    • @neokyu
      @neokyu Před rokem +2

      Hey, just trying to help out, your program will only work for lowercase "k" for kilograms, and if you use "K" it will go to the else part of the if statement. Also, when you're saying "else", it will take everything other than "k", so if you were to type "a" , "b", "c", etc.. it would count it as being something other than "k" :)

    • @abiodunaghedo550
      @abiodunaghedo550 Před rokem

      @@neokyu I do not understand 🤨

    • @justirungu
      @justirungu Před rokem

      why is my code not going beyond the if statement?
      Weight=int(input("Weight:"))
      unit=input("(k)g or (l)bs")
      if unit=="k":
      convert=Weight/0.45
      print("Weight in kgs is "+str(convert))
      else:
      convert=Weight*0.45
      print("Weight in lbs is"+str(convert))

    • @uroojfatima6456
      @uroojfatima6456 Před 9 měsíci

      Here's my solution:
      weight = float(input("Enter weight: "))
      unit = input("Enter unit, K for kg and L for lbs: ")
      if unit == "k" or unit == "K":
      print("Weight in kgs: " + str(weight/0.45))
      elif unit == "l" or unit == "L":
      print("Weight in lbs: " + str(weight*0.45))
      else:
      print("Invalid unit! ")

  • @PrimeGorilla
    @PrimeGorilla Před rokem +337

    Exercise 8:50
    name = 'John Smith'
    age = '20 year old'
    status = 'New Patient'
    print(name, age, status)
    Exercise 14:50
    First = input('First number: ')
    Second = input('second number: ')
    Sum = float(First) + float(Second)
    print(Sum)
    Managed this one after some try and error😅

    • @LemynLyme
      @LemynLyme Před rokem +13

      lol I had to cheat and look at the answer for the second one. Tried to do it the "lazy" way and kept accidentally combining the two numbers together.

    • @saluvideos142
      @saluvideos142 Před rokem +9

      age=20

    • @sagarkarki7059
      @sagarkarki7059 Před rokem +4

      Age variable should be integer type
      And you should use boolean expression for the last one of first exercise probably, i think!
      And yeah no quotaion for all data.

    • @zetxen5270
      @zetxen5270 Před rokem +26

      @@sagarkarki7059 so It should look like this?:
      name = 'John Smith'
      age = 20
      is_newPatient = True

    • @sagarkarki7059
      @sagarkarki7059 Před rokem +8

      @@zetxen5270
      Exactly sir.

  • @Dragonlover-kp6ki
    @Dragonlover-kp6ki Před 13 dny

    Since you asked.
    Im learning this cause i want to spice up my gaming worlds.
    Mostly minecraft.
    I have a ton of mods that i play with, but i dont get to try all of them as by the time im at the end game they are pointless to use sometimes.
    I want to have the ability to play again, and again in the same world with a different beginning and midgame each time.
    Some mods add npcs to make my world come alive, but to make them give quests or move to do stuff i need to learn how to code.
    Learning python will allow me to play in my own world for longer and when i add my friends to it they will hopefully have a similar experience to skyrim. The ability to play the game with new items, game mechanics, and cool quests! this will hopefully get them excited for whats next in thier next adventure.
    Thank you!

  • @user-on8ep7qb7c
    @user-on8ep7qb7c Před 10 dny

    Thank you for the turotial.
    Exercise 1:
    age = 20
    first_name = "John"
    last_name = "Smith"
    is_new_patient = True
    print("Check In")
    print (f"Name {first_name,last_name}")
    print (f"Age: {age}")
    if is_new_patient :
    print("New patient")
    else:
    print("Existing patient")

  • @indiana1120
    @indiana1120 Před 2 lety +11

    Thank you! I've been out of practice for years, and with this video, all of the basics came flooding back to me. Just what I needed

  • @jeffrey6296
    @jeffrey6296 Před rokem +319

    9:06
    name = ‘John Smith’
    age = 20
    patient_status = ‘new’
    print(name, age, patient_status)
    15:00
    num1 = input(‘First’)
    num2 = input(‘Second’)
    sum = int(num1) + int(num2)
    print(sum)

    • @unununium8481
      @unununium8481 Před rokem +11

      I did the exact same thing for the first exercise.

    • @hitoriotaku1069
      @hitoriotaku1069 Před rokem +12

      i did the same thing for the second exercise but with sum = float instead of int

    • @ZARearth
      @ZARearth Před rokem +12

      name = "Patient's name: " + "John Smith"
      age = "Age: " + str(20)
      status = "Patient's status: " + "new"
      print(name)
      print(age)
      print(status)

    • @MrDeshawn124
      @MrDeshawn124 Před rokem +8

      I was wayyy off... had too many extra variables... glad I cheated and took a look here

    • @jeffrey6296
      @jeffrey6296 Před rokem +1

      @@MrDeshawn124 Glad that that I helped you :3

  • @HappyCaucasianFilmer
    @HappyCaucasianFilmer Před 3 měsíci

    For the exercise at 36 minutes: You need to convert the weight into an int for it to run properly since it is still in str format
    weight = input("Please enter your weight")
    unit = input("(K)g or (L)bs: ")
    if unit.upper() == "K":
    converted = int(weight) / 0.45
    print("Weight in Lbs: " + str(converted))
    else:
    converted = int(weight) * 0.45
    print("Weight in Kgs: " + str(converted))

  • @xSenwar
    @xSenwar Před 6 dny

    Exercise 1
    age = 20
    name = "John Smith"
    patient_status = True
    print("Name",name)
    print("Age",age,"years old")
    print("Patient Status")
    print("New Patient") if patient_status is True else print ("Returning Patient")
    I actually remembered a bit from a course in high school a while back and implemented that in!

  • @rahafal-hatab4993
    @rahafal-hatab4993 Před 2 lety +27

    Ex 1:
    name=“john smith”
    age=“20”
    print(“we check in a patient named”+name)
    print(“He is”+age+”years old”)
    print(“He is a new patient”)
    Ex 2 :
    first =input(“first:”)
    second=input(“second:”)
    sum= float(first)+float(second)
    print(sum)
    ex 3:
    weight=float(input("enter the weight here : "))
    type=input("what unit your weight is ? (K) for kg or (l) for bs : ")
    if type.upper()=="K" :
    convert= weight/0.45
    print("weight in LBS : " + str(convert))
    elif type.upper()=="L" :
    convert= weight*0.45
    print("weight in KGS : "+ str(convert))
    print("DONE")

  • @kerriganwhite2190
    @kerriganwhite2190 Před 2 lety +8

    I've hated programming and felt that I'm worthless at it, but I need to learn python for work. I'm only 20 minutes in and all of this is making so much sense to me, and it doesn't only make sense but it's fun as well. I couldn't for my life code anything out of my own head before, other than "Hello world!". This is really life changing for me, thank you so much.

  • @saadkamboh5731
    @saadkamboh5731 Před 7 dny

    exercise 3
    weight = input("Enter your weight: ")
    unit = input('Is the weight in (K)g or (L)bs ' )
    if unit=='k' or unit=='K':
    converted = float(weight * 2)
    print("Your weight in pounds is ",converted)
    elif unit=='L' or unit=='l':
    converted = float(weight / 2)
    print("Your weight in kilograms is ",converted)

  • @premkarki2
    @premkarki2 Před 11 měsíci +45

    I watched this many times. As a beginner, this is very useful to me. Thanks Mosh.

  • @StonagePwnage
    @StonagePwnage Před 2 lety +333

    I have always been interested in coding but never have actually tried it, I'm 13 minutes into this video and I am practicing/learning for the first time & I am already learning and having fun, thank you so much man!

    • @Baker4life777
      @Baker4life777 Před 2 lety +6

      on the same journey friend. hope to see you at the top!

    • @conniebarrick8265
      @conniebarrick8265 Před 2 lety +10

      I'm writing this in Aug. 2021, already decided to go into computer programming just this year. Python is just one of my goals and Notepad++. I also decided to come out of retirement to enter this great future of ahead for all of us. Addition, to live a better and with more money type of life, why not say that!

    • @forthehomies7043
      @forthehomies7043 Před 2 lety +3

      @@conniebarrick8265 hi connie welcome to the journey:) best of luck to you - one day we'll be using apps that we've coded ourselves, see you down the road.

    • @conniebarrick8265
      @conniebarrick8265 Před 2 lety +1

      @@forthehomies7043 Yes, I will see you

    • @conniebarrick8265
      @conniebarrick8265 Před 2 lety +1

      You see, it doesn't take much to improve 's oneself. Just, keep going, this is a big and profitable field (computer programs) to achieve in. Your limit is the sky!

  • @ambygonzales1077
    @ambygonzales1077 Před měsícem

    I'm from philippine and want to shift course about programming. Thank you for free tutorial so much appreciated.