Three years ago, I viewed this video,and now,I hold the position of Sr.Python developer. Gratitude to Mosh for the guidance.
@Ndujlz10 ай бұрын
congratulations!
@ots935810 ай бұрын
Mentor me please!
@iyaiya981910 ай бұрын
@@ots9358me too please 🙏
@sparkdrive290010 ай бұрын
Good job, my little indian friend
@antanette150510 ай бұрын
Im encouraged by this post
@Seraphvonteschen4 жыл бұрын
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 couldn't go any further. You all are the best!
@CodingPerspective4 жыл бұрын
You can improve your coding skill with our videos
@toughcookie2504 жыл бұрын
Absolutely amazing, you will be rewarded for your hard work, never give up and keep pushing forward!
@massrdmdoer73484 жыл бұрын
good for you man
@enjoybas4 жыл бұрын
wish you good luck. God bless you.
@madhatter26873 жыл бұрын
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.
@codingmadeclear22293 жыл бұрын
This guy, sat for 1 hour and talked about python, and then released it for free. legend
@Taste_off_life3 жыл бұрын
Is it really worth for beginners ?
@codingmadeclear22293 жыл бұрын
@@Taste_off_life Yeah I think its an great course for beginners tbh
@pragmaticai3 жыл бұрын
Here is another video called Python in One Hour published a few months before this one enjoy! kzbin.info/www/bejne/n5aQmZ18jdGritU
@kirtanpatelium30653 жыл бұрын
@@codingmadeclear2229 true lots of knowledge for the beginners that have no idea🙏🏼
@salah1x3 жыл бұрын
With 1.3M views, he made around 6,000 USD and counting. No one does anything for free
@mediamannaman25 күн бұрын
I have been retired for 10 years, but I started my career in 1985 as a software developer writing business applications. So, I understand programming concepts but I never learned Python. Mosh is a natural teacher and this 1-hour video is such a good kickstart to get up and running. Thanks!
@yiwantao9622 Жыл бұрын
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
@Krooscc7 Жыл бұрын
Thanks 😊
@Tylanola Жыл бұрын
Absolute G
@KalavathiBannuru Жыл бұрын
Absolute OH
@pijushbiswas55 Жыл бұрын
thanks
@ElementalStudios_1 Жыл бұрын
@@pijushbiswas55 you do realise that mosh already put those in the link area, right?
@matthewrennie111011 ай бұрын
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
@shamlashibushamlashibu9622 ай бұрын
😂😂😂
@fornitegod312 ай бұрын
yeah its best to learn on KZbin tutorials instead of going to class its gonna bring ya none lost
@AminataSesay-g4cАй бұрын
😂😂😂😂😂😂
@AminataSesay-g4cАй бұрын
@@fornitegod31😂😂😂😂😂
@tanahunriderprince Жыл бұрын
second exercise code firstnumber=input("first number") secondnumber=input("second number") sum=float(firstnumber)+int(secondnumber) print(sum) thanks for all the time and education you have put for us mate really appreciate
📖 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
@sofiamozaleva40944 ай бұрын
Thank you so much!
@AmayrTheCrown4 ай бұрын
Thanks bro appreciate it!
@ifyahadone3 ай бұрын
it's in the description but ok
@Balzz899 ай бұрын
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]
@blengblong017128 ай бұрын
I'm wondering why (if unit == "K" or "k") doesn't work
@artgus13568 ай бұрын
@@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
@blengblong017128 ай бұрын
@@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
@blengblong017128 ай бұрын
@@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)
@rosswo8348 ай бұрын
Theres small mistake on the first exercise, on the bool
@Resthetix4 күн бұрын
lets start shall we? 36:51 weight converting excercise: weight = float (input ("enter your weight")) unit =Input ("Is the weight in (K)g or (L)bs? ") if unit== 'k': converted_weight= weight * 2.205 print ( "your weight is", converted_weight) elif unit== 'l': converted_weight = weight/2.205 print ("your weight is" , converted_weight)
@albolvo2 жыл бұрын
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!
@TasmanianTigerGrrr2 жыл бұрын
Good for you! How is it working for you?
@albolvo2 жыл бұрын
@@TasmanianTigerGrrr it's challenging not having a strong technology background. Lots of deep immersion and catching up but I will get there!
@oca12532 жыл бұрын
How's life going man?
@Sucrose__2 жыл бұрын
@@oca1253 it's been 2 weeks, dude
@albolvo2 жыл бұрын
@@oca1253 still plugging away, learning as much as I can as fast as I can. You wanna tutor me?
@Sopherian2 жыл бұрын
Exercice 8:50 Name = ("John Smith") Age = 20 Status = ("New patient") print (Name, Age, Status,) Exercice 14:50 first = input("Number: ") second = input("Plus: ") sum = float(first) + float(second) print("Awnser: " + str(sum)) Exercice 36:17 weight = float(input("What is your weight? ")) unit = input("(K)g or (L)bs: ") if unit.upper() == "K": converted = weight / 0.45 print("Weight in Lbs: " + str(converted)) else: converted = weight * 0.45 print("Weight in Kgs:" + str(converted))
@rreynz54602 жыл бұрын
good job, although on the first exercise there is no need to put brackets around the quotation marks within the variable. First_name = "John" would work fine same with his surname but it works so well done
@rreynz54602 жыл бұрын
@@prajwalacharya4791 what is the error?
@rreynz54602 жыл бұрын
@@prajwalacharya4791 make sure in your previous cide you entered an upper case K so it referres to that "K"
@rreynz54602 жыл бұрын
@Rougue Ninja for some aspects but for variables there is no need for them
@Stone4show2 жыл бұрын
@@rreynz5460 Remove the .upper() from the code at the top of the unit part and the code will work as supposed.
@bksanpvlog Жыл бұрын
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
@basementcattiger Жыл бұрын
for the first exercise right answer is `is_new = True` , not ' P_admit="New"'
@snikiniki7459 Жыл бұрын
@@basementcattigeryall are slay For doing this omaga
@Blender-co6vd Жыл бұрын
@@basementcattiger why? It is up to him what variable he chooses
@dedicategrinder88 Жыл бұрын
thanks, had to confirm if got right, no answers :(
@onayesabdullah21 Жыл бұрын
thank you
@kingslyso714421 күн бұрын
Thank you for your teaching. It's my answer below. EX1// print("Name: John Smith") print("Age: 20") print("Note: He is a new patient") EX2// a= input("First: ") b= input("Second: ") ans= float(a)+float(b) print("Sum: ", ans) EX3// c= float(input("Weight: ")) d= input("(K)g or (L)bs: ") if d.lower()=="k": print("Weight in Lbs: ", c/0.45) elif d.lower()=="l": print("Weight in Kgs: ", c*0.45) else: print("Don't joking me")
@Invincible_Dreams1549 күн бұрын
I did the same code but then some other guy in the comments used str and all
@everestdennis47922 жыл бұрын
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.
@prodgers712 жыл бұрын
I 100% agree!!!!
@shnitsel2 жыл бұрын
@@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.
@sarthak77082 жыл бұрын
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_2 жыл бұрын
he made another subscriber
@ugonnaubaka50482 жыл бұрын
He’s too good tbh, A gem
@margarethsanchez9102 Жыл бұрын
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 Жыл бұрын
Mind if I copy your homework?
@KevinLin45 Жыл бұрын
@@Eleventyeleventh do it yourself dude.
@woolzem Жыл бұрын
Thank you ❤ day one learning
@simplekudos Жыл бұрын
a = input("First: ") b = input("Second: ") sum = float(a) + int(b) print("Sum = " + str(sum))
@rima1661 Жыл бұрын
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: ")
@3BnDo7 ай бұрын
I've taken a C++ in college years ago with a bad instructor that made me hate coding. Coming back with your simple and clear explanation to this nice language made me wanna learn more. Thanks a lot, Mosh.
@solitudeispeaceful6 ай бұрын
Same story...from then Coding looks like rocket science to me
@chaelynxzbetsayda83986 ай бұрын
@AthmarMubarkis it hard? many people say programming needs a talent. I will go to college next year and I'm kinda not sure about my future in coding but I want it
@AnythingYashubh6 ай бұрын
What degree did you did?
@countergravity63715 ай бұрын
@@chaelynxzbetsayda8398 Just take your time to understand each element implicitly and apply your own logic to it. You'll get there.
@sonozaki00005 ай бұрын
I had a similar experience! I failed a Python course at college in 2021 because it was structured oddly and the professor was too rude to ask for help (treated people like they were dumb for not getting it right away). this video was SO much easier to grasp, and now I'm embarrassed that I learned in one day what I failed to figure out over an entire summer course LOL
I did this first = int (input ("First Number")) second = int (input ("Second Number")) print(first + second)
@NoobNoob70-1 Жыл бұрын
first = float (input ("First Number")) second = float (input ("Second Number")) print(first + second) is better :)
@EpicViralShortsz Жыл бұрын
I made this: first_name = "John" second_name = "Smith" age = 20 New_Patient = True
@PeaceNinja007 Жыл бұрын
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?
@claydice91 Жыл бұрын
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 Жыл бұрын
good luck brother.
@zombiebotnet343 Жыл бұрын
good luck man
@claydice91 Жыл бұрын
@@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 Жыл бұрын
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 :)
@Kaydoesnails Жыл бұрын
Did the video work?
@bogdanivascu89702 жыл бұрын
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!
@neokyu2 жыл бұрын
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" :)
@abiodunaghedo5502 жыл бұрын
@@neokyu I do not understand 🤨
@justirungu2 жыл бұрын
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 Жыл бұрын
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! ")
@meilinfjellstad7168 Жыл бұрын
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 Жыл бұрын
Plz tell me the name of those books.❤
@meilinfjellstad7168 Жыл бұрын
@@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 Жыл бұрын
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!
@Cloudiee-m4d Жыл бұрын
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 Жыл бұрын
@@williamsusa5067 e
@JeanVignes-f2z3 ай бұрын
I am 68 (but who's counting? ha-ha) and I'm interested in learning Python because my company is using Snowflake, which allows you to code within its worksheets in either ANSI SQL (which I have been using for decades) or Python. A programmer is a lot like a shark: you must always be moving forward or bad things will happen to you...and to your career. Three years after releasing this video, you are still helping people. Thank you!
@miserts76572 ай бұрын
Me too
@HasanSaleh7Ай бұрын
😂😂thnx for the advice
@bassazoidАй бұрын
36:20 weight = int(input('Enter in weight to convert: ')) unit = input('(K)g or (L)bs: ') if unit.lower() == 'k': weight = weight * 2.20462 print('Weight in lbs: ' + str(weight)) elif unit.lower() == 'l': weight = weight * 0.45392 print('Weight in kgs: ' + str(weight)) else: print('Unit does not exist, retry program')
@hungnguyen22922 жыл бұрын
15:00 a = input('First: ') b = input('Second: ') c = float(a) + float(b) print('Sum: ' + str(c)) 37:00 a = input('Weight: ') b = input('(K)g or (L)bs: ') if b == 'l' or b == 'L': c = float(a) * 0.45359237 print('Weight in Kg: ' + str(c)) if b == 'k' or b == 'K': c = float(a) / 0.45359237 print('Weight in Lbs: ' + str(c))
@perrytucker50042 жыл бұрын
Show error message when anything else other than K/k or L/l is entered if unit.upper() == "K": # K/k entered converted = float(weight) / 0.45 print("Weight in Pbs: " + str(converted)) elif unit.upper() == "L": # L/l entered converted = float(weight) * 0.45 print("Weight in Kgs: " + str(converted)) else: # anything other than K/k or L/l entered print("Invalid weight unit entered")
@janaockova9924 Жыл бұрын
weight = input ("Weight: ") unit = input ("(K)g or (L)bs: ") weight_kg = float(weight)//2.2 weight_lbs = float(weight)*2.2 if unit == "l": print ("Weight in Kg: " + str(weight_kg)) elif unit == "k": print("Weight in Lbs: " + str(weight_lbs)) else: print("Invalid weight unit entered, use k for kg and l for lbs, please.") _____________ Weight: 10 (K)g or (L)bs: k Weight in Lbs: 22.0
@ksatyasirisha20133 жыл бұрын
17:20 - 17:47 you don't need to change the float into a string. just change the "+" into a "," y = float(input('enter your first num: ')) x = float(input('enter your second num: ')) print('the sum is: ', x + y) try this, this works too.
@socialloner25484 жыл бұрын
started learning python with mosh through his KZbin tutorials. I watched the one which is over 6 hours and the other one which is 2 hours. Mosh explains everything crystal clear. I really had no prior knowledge in programming and this whole programming world or whatsoever. And it seemed very daunting to me. But I gotta say thanks to mosh I started believing that I might be able to actually make it in the programming world. I even purchased his complete python mastery course on his website. Best purchase I've ever made. No regrets ! In fact I wish I found mosh earlier ! I'm planning to move to HTML, CSS, and JavaScript after I finish python. Mosh, if you're reading this. I just want you to know that I'm really grateful for what you do and appreciate your hard work buddy :)
@pleaseunsubscribeme85334 жыл бұрын
I will also purchase the entire course after the beginners course...
@kovi27724 жыл бұрын
@@programmingwithmosh I just got a new job and they told me they would teatch me python so i wanned to learn first at home. i have some prio knowledge of html and css.
@unknown-wy3ch4 жыл бұрын
@@programmingwithmosh which tutorial i want to watch 6 hrs one or this video I'm new to coding please give me a reply sir
@AEWYU4 жыл бұрын
yes he does indeed and sometimes I make a mistake and I like that because I can just go back in the video and try to figure out what I did and if it doesn't show then I have to be smart with it like just now I was doing a calculator and I was trying to do this print("Sum: " + answer) but it wasn't working so I looked back in the video, saw that it was a str it was printing and not an int and did this print("Sum: " + str(answer)) and now it works
@akhilkakani312 жыл бұрын
uhuh
@TechGamerzRapidGaming15 күн бұрын
15:00 Here you go. Second Script. print('Welcome to Calculator!') # Welcome Screen number1 = float(input("Enter first number: ")) # First Number number2 = float(input("Enter second number: ")) # Second Number Sum = number1 + number2 # Sum Difference = number1 - number2 # Difference Product = number1 * number2 # Product Quotient = number1 / number2 # Quotient print('Sum =',Sum) # Answer print('Difference =',Difference) # Answer print('Product =',Product) # Answer print('Quotient =',Quotient) # Answer
@NintendoSunnyDee3 ай бұрын
Thank you for this! I did all of the exercises in the video, but the only one I wanted to share was this one: weight = float(input("What is your weight? ")) type = input("(K)g or (L)bs: ") constant = float(0.4536) if type.upper() == "K": value = weight / constant print(str(value) + " in Pounds") elif type.upper() == "L": value = weight * constant print(str(value) + " in Kilograms") else: print("Americans will use ANYTHING besides metric, huh?") print("Done")
@Jackito12 жыл бұрын
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
@cameronreed44762 жыл бұрын
lol right with you man
@ahowardcg2 жыл бұрын
help desk support for 15 years network support for 2 im freaking over it
@pythonez87192 жыл бұрын
exactly!. working on my videos rt now to get them this good and explained well. feedback is appreciated
@RPGeezzy2 жыл бұрын
im in the same boat man! lol
@Jackito12 жыл бұрын
@@pythonez8719 preciate you doing that. I'm subscribed
@armarhb3 ай бұрын
36:20 weight = float(input("Enter your weight in your unit: ")) print("Put the corresponding letter for the unit you want to convert to: Put a 'L' for Lbs, or put a 'K' for KG") conversion = input("To what unit would you like to convert: ").lower() if conversion =="l" or conversion =="lb": result = weight * 2.20462 print(f"{weight} Kg converted to Lb is {round(result, 2)} Lb") elif conversion =="k" or conversion =="kg": result = weight * 0.453592 print(f"{weight} Lb converted to Kg is {round(result, 2)} Kg")
@galahadlance3 ай бұрын
I did it shorter weight = input("Enter your weight: ") unit = input("If in kg type (K) and if in lbs type (L): ") if unit == "K": print("weight in lbs:" , float(weight) * 2.20462) elif unit == "P": print("weight in Kg:" , float(weight) / 2.20462)
@galahadlance3 ай бұрын
I forgot giving option the lower case in the if statement, my bad.
@leylow012 ай бұрын
weight = input(“Weight: “) korlbs = input(“(K)g or (L)bs: “) if korlbs.upper() == “K”: print(f”You weigh {float(weight) * 2.2046} in pounds”) elif korlbs.upper == “L”: print(f”You weigh {float(weight) / 2.2046} in kilograms”) else: print(“Please input a valid response.”)
@TeamOdiffat2 ай бұрын
@@galahadlance weight = float(input("Weight? ")) typ = (input("kg or lbs? ")) if typ.upper() == "KG": print("Your Weight In lbs= ", (weight * 2.2)) elif typ.upper() == "LBS": print("Your Weight in kg", weight / 2.2) else: print("Weight Unit Not LBS or KG")
@josepaniagua44352 ай бұрын
weight = float(input("Weight: ")) convt = input("(K)g or (L)bs: ") wc = float(2.20) if convt == 'K' or convt == 'k': new_weight = weight/wc print("Weight in Kg: " + f"{new_weight:.2f}") elif convt == 'L' or convt == 'l': print("Weight in Lbs: " + f"{weight:.0f}")
@STK_ItsukaАй бұрын
I have a programming course in college, and I need to complete a project within a month. You've been a great help. Thank you so much for your work and effort.
@jeffrey62962 жыл бұрын
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)
@unununium84812 жыл бұрын
I did the exact same thing for the first exercise.
@hitoriotaku10692 жыл бұрын
i did the same thing for the second exercise but with sum = float instead of int
@ZARearth2 жыл бұрын
name = "Patient's name: " + "John Smith" age = "Age: " + str(20) status = "Patient's status: " + "new" print(name) print(age) print(status)
@MrDeshawn1242 жыл бұрын
I was wayyy off... had too many extra variables... glad I cheated and took a look here
@jeffrey62962 жыл бұрын
@@MrDeshawn124 Glad that that I helped you :3
@Proche27 Жыл бұрын
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
@AleeraLex Жыл бұрын
same, class is a mess in my brain so scattered and too advanced
@AdvaitBanerji Жыл бұрын
L @@AleeraLex
@yourlocalonionguy9674 Жыл бұрын
True
@nickjames265111 ай бұрын
Exactly! Like my intro class needed a freaking intro class haha
@christopheraledo54203 жыл бұрын
for the exercise at 37:00 weight = float(input("Weight: ")) unit = input("(K)g or (L)bs ").upper() userWeightK = float(weight * 2.2) userWeightL = float(weight / 2.2) if unit == 'K': print("Weight in Lbs: " + str(userWeightK)) elif unit == 'L': print("Weight in Kg: " + str(userWeightL))
@damianaustin11523 жыл бұрын
I'm struggling so hard with this i dont know why :/
@stormsly3 жыл бұрын
I did something a little different, I have previous knowledge with Lua so some of the things I do are habit and trying to make beautiful code. I do like your use of the .upper() function directly on the unit input! Good job! weight = float(input("Weight: ")) unit = input("(K)g or (L)bs: ") if unit.lower() == "k": print("Weight in Lbs: " + str(weight // 0.45)) elif unit.lower() == "l": print("Weight in Kgs: " + str(weight * 0.45))
@kaulsay643 жыл бұрын
U should do if weight== "K" or "k": print(). This will account for the possibility if the user enters k or K
@makito1065 күн бұрын
15:00 First = input("First: ") # input stores the data as a string Second = input("Second: ") Sum = float(First) + float(Second) # float converts the string into a float aka numbers print(" Sum: " + str(Sum)) # str converts the float into a string
@LuisVasquez-mq8nc2 ай бұрын
Amazing tutorial here's my code for 36:58 weight = input("what is your weight? ") KgP = input('in Kg(K) or in pounds(p) ') if KgP == 'p' or KgP == 'P': weight = float(weight) * 0.453592 print('Weight in Kg is ' + str(int(weight))) elif KgP == 'k' or KgP == 'K': weight = float(weight) * 2.20462 print('Weight in pounds is ' + str(int(weight))) else: print("please try again and use K or p")
@aniruddh2087 Жыл бұрын
Hi, Mosh. Am an absolute beginner. Thank you for the amazing video. First Exercise : First_Name = "John" Last_Name = "Smith" age = 20 Patient_Type = "New" print(First_Name, Last_Name, age, Patient_Type)
@winnie3963 Жыл бұрын
Wow
@destinyamenaghawon1863 Жыл бұрын
Thanks alot, this was helpful. i,m also a beginner
@psychopillia7865 Жыл бұрын
age = 20 name = "John Smith" is_new = True print("Details of John Smith") print("Age =",age, "Name = ",name) if (is_new==True): print("The patient is new") else: print("This is an old patient") Here is bit more simple but advanced version hehe
@adambeck6799 Жыл бұрын
wait hold up that works ??? damn bro you so good hahahah @@psychopillia7865
@CubeHeadFanYoo Жыл бұрын
you should not use if (is_new==True): you should use is and about the details of John smith you should change it to print("Details of %s.)%name thats it!@@psychopillia7865
@PrimeGorilla2 жыл бұрын
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😅
@Lemyn_Lime2 жыл бұрын
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.
@saluvideos1422 жыл бұрын
age=20
@sagarkarki70592 жыл бұрын
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.
@zetxen52702 жыл бұрын
@@sagarkarki7059 so It should look like this?: name = 'John Smith' age = 20 is_newPatient = True
@sagarkarki70592 жыл бұрын
@@zetxen5270 Exactly sir.
@pingupie7770Ай бұрын
36:20 This took a bit longer than 5 minutes but im proud of it for having basically no prior coding experience unit = input("Enter 1 for kg or 2 for lbs ") weight = input("Enter weight in specified unit ") if int(unit) == 1: converted = (float(weight) * 2.205) string = converted.__round__(1) print("≈ "+str(string)+" lbs") elif int(unit) == 2: converted = (float(weight) / 2.205) string = converted.__round__(1) print("≈ "+str(string)+" kg")
@Xiams2 жыл бұрын
This was really fantastic. I have no prior Python experience and was able to keep up and even experiment a little during the exercises. Thank you so much!! 8:50 last_name = "Smith" first_name = "John" age = 20 patient_status = "New Patient" print(last_name,", ",first_name,". Age: ",age,". ", patient_status) 15:03 first = input(" Let's add 2 numbers. First: ") second = input("Second: ") sum = float(first)+float(second) print("Together those equal",sum) 36:22 weight = float(input("Let's convert your weight. How much do you weigh? ")) mass = input("Is that in (K)g or (L)bs? ") if mass.upper() == "K": print("In Pounds, you weigh: ", weight * 2.21) elif mass.upper() == "L": print("In Kilograms, you weigh: ", weight * 0.45) else: print("U r confused.") print("Have a nice day!") Blooper at 1:00:01
@miguelreyntjens97232 жыл бұрын
Thank you for telling me about the blooper, totally missed it!
@abiodunaghedo5502 жыл бұрын
What goood answers they are all corect you are smart to know the answers to this code. Did you copy from the video. I think you did Daniel Delgado: Yes I copied I just wanted to see the answers Me: LOL! 🤣
@abiodunaghedo5502 жыл бұрын
@@miguelreyntjens9723 What is the blooper?
@Dafakizdat2 жыл бұрын
@@abiodunaghedo550 you alright?
@m.mccormick02 жыл бұрын
@@Dafakizdat i was wondering the same thing
@scythe_ghoul4 жыл бұрын
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 For those who need
@AreosOriginal4 жыл бұрын
or check the description
@scythe_ghoul4 жыл бұрын
Ya but those who dont for them dude
@Andrew-ps9bu4 жыл бұрын
he did this already but i like the effort
@timtalksanimations91714 жыл бұрын
@@Andrew-ps9bu Guy literally copy pasted the desc, there's no effort here.
@meenakshisingh21584 жыл бұрын
kzbin.info/www/bejne/Z4ese5mird-isK8
@Drt0Kkdo2 жыл бұрын
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.
@bryantaylor6832 жыл бұрын
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.
@StormykaktusАй бұрын
36:10 weight = float(input("Weight: ")) unit= input("(K)g or (L)bs: ") if unit.upper() =="K": conv=weight / 0.45 print (conv) if unit.upper() =="L": conv=weight *0.45 print (conv)
@513RR4 Жыл бұрын
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 Жыл бұрын
Still a long way to go before becoming a game developer but knowing the basics is definitely necessary.
@cometbluestrike Жыл бұрын
keep it up
@MK-ib8ch11 ай бұрын
How's it going? I'm doing the same mind sharing your contact
@torivega0179 ай бұрын
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++
@luckyluck92597 ай бұрын
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👍
@et26083 жыл бұрын
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!
@arkkingom81913 жыл бұрын
Teachers are useless at explaining but not all of them
@ammblackish12942 ай бұрын
have noticed , there is the way ma brain opens whenever he utters
@hamdallahsanusi7373 жыл бұрын
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.creeper64843 жыл бұрын
Good Luck!
@Senorpoontang9 ай бұрын
How has your journey been so far? Where are you now in terms of coding?
@dhuntersfam55482 ай бұрын
Exercise 1 Name = "Jhon Smith" age = 20 Regular_Customer = False print (Name) print (age) print (Regular_Customer)
@scenessounds361426 күн бұрын
for anyone struggling with print (Name) if you include "" it should resolve your problem
@chaditv24933 жыл бұрын
15:08 print("Enter your numbers below") first_num= input("First: ") second_num = input("Second: ") sum = float(first_num) + float(second_num) print(f"Sum: {sum}")
@saritamahato69403 жыл бұрын
Good job
@DivinityinLove2 жыл бұрын
Forgot about float, thanks! but I just did: first = input("Enter first number: ") second = input("Enter second number: ") sum = float(first) + float(second) print(sum) totally forgot what print(f'Sum: {sum}') even does :/ I need to revise. But the code I used seemed to work fine with floats.
@salvadorantunes40625 ай бұрын
36:20 print("Welcome to the Weight Converter") weight = input("Weight: ") massa = input("(K)g or (L)bs: ") if massa.upper() == "K": print(float(weight) * 2.2) elif massa.upper() == "L": print(float(weight) * 0.5) else: print("You must type 'K' for kilograms or 'L' for pounds")
@konstantinkiriyenko58164 ай бұрын
The part with the unit converter, it gives wrong calculations because of those weird numbers. For example If you type in 165 pounds, what's supposed to be around 75 kg, it will give me number 82.5 . I'd use standard formula multiplying or dividing it by 2,205.
@konstantinkiriyenko58164 ай бұрын
but yeah who cares about lbs xd
@victorikua2 жыл бұрын
Exercise 37:00 weight = input("weight: ") unit = input("Choose (L) or (K): ") if unit.upper() == "K": print("weight in pounds is: ",int(weight)/.453592) elif unit.upper() == "L": print("weight in Kg is: ", int(weight)*.453592) 👍
@reqssss2 жыл бұрын
ty
@victorikua Жыл бұрын
@@reqssss Anytime
@boredgamesph48722 ай бұрын
37:00 weight = float(input("Weight: ")) w_type = str.lower(input("(K)g or (L)bs: ")) if w_type == "l": k_weight = round(weight * 0.45359237,2) print(f"Weight in Kg is {k_weight}") elif w_type == "k": l_weight = round(weight * 2.20462262,2) print(f"Weight in lbs is {l_weight}") else: print("Please input weight type properly")
@rahafal-hatab49933 жыл бұрын
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")
@TimothyMouradian2 ай бұрын
Why do you put "20" in ex 1?
@officiall_olawale2 ай бұрын
@@TimothyMouradian i thought as much.
@barrackroy97763 жыл бұрын
Mehn I've been a lazy programming student but I just can't stop learning with your videos, so straight forward . thanks Mosh
@shahabuddin1269 ай бұрын
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.
@supersupergam3r2 ай бұрын
36:51 in case you were wondering answer is ⬇⬇⬇ weight = input("How much do you weigh? ") ↙↙↙ unit = input("(K)g or (L)bs? ") if unit.upper() == "K": c = float(weight) / 0.45 print("You weigh " + str(c) + "lbs (approx.)") else: c = float(weight) * 0.45 print("You weigh " + str(c) + "kg (approx.)") if unit.lower() == "K": c = float(weight) / 0.45 print("You weigh " + str(c) + "lbs (approx.)") else: c = float(weight) * 0.45 print("You weigh " + str(c) + " kg (approx.)")
@paulcantshutup2 жыл бұрын
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!
@Linkolite2 жыл бұрын
Dude as I was reading this it happened! That’s a really nice touch, great education technique
@trspanda21572 жыл бұрын
Jesus loves us all that's why he died for our sins.
@barknburcu57662 жыл бұрын
@@trspanda2157 fake
@Daniel-oc2mu2 жыл бұрын
@@barknburcu5766 wake up before it gets too late. Don't find yourself in hell later, while ignoring this message.
@barknburcu57662 жыл бұрын
@@Daniel-oc2mu what?
@johnm.64147 ай бұрын
I've been a cook for 18 years and I'm ready for something new and better. Can't wait to fully learn this!
@SheilaDang-ik1hc5 ай бұрын
how’s it going so far?
@LinguisticG4m3rBoi_qy1yn5 ай бұрын
Yes! You can do this! I believe in you and I hope you good luck for your future endeavours! :)
@MarcoHernandez-nb5dc5 ай бұрын
U were born to cook bro 😢, coding is boring
@LinguisticG4m3rBoi_qy1yn5 ай бұрын
@@MarcoHernandez-nb5dc Its fine! People have their different opinions and thats what makes us special! So if they want to be a coder who says they can't! If coding is boring for you maybe try something new!
@Dave.Mustaine.Is.Genius4 ай бұрын
@@LinguisticG4m3rBoi_qy1ynwhat are ye gonna do by learning coding if ye are not an engineer? What's it gonna teach ye about human, nature, existence and God? Almost nothing, I guess. (Btw I love Azula, I bang her everynight)
@ZAH33D2 жыл бұрын
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_2 жыл бұрын
Thanks man this actually helped me correct some of my mistakes
@bts10732 жыл бұрын
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?
@manumedleri13552 жыл бұрын
Tq man 👍
@saidit0nc3662 жыл бұрын
mashallah, thank you ahki, started learning about three weeks ago and this help a lot.
@themidnightmoon17402 ай бұрын
weight=int(input('enter a number')) unit=input('kg or lbs:') if unit=='KG' or 'kg' : converted=weight/0.45 print('weight in lbs:', converted ) elif unit=='LBS' or 'lbs' : converted=weight*0.45 print('weight in kg:', converted) else: print ('WhAt??') 36:53
@Linuxfy4 жыл бұрын
I just print "Hello World" in the terminal. I'm waiting for an email from Google Software Engineer.
@realnice36724 жыл бұрын
xd
@nevang63144 жыл бұрын
you got no chance. i have an input for your age and then prints your age. sorry but im getting in google :)
@aryangirijan30084 жыл бұрын
Aww
@HarryMator4 жыл бұрын
*i remembered the brackets, you have no chance*
@aryangirijan30084 жыл бұрын
@@HarryMator sad I remember input function not brackets unlike u *no one stands against me now*
@veereshbadiger43822 жыл бұрын
Exercise 14:50, most of them given out put as print(sum) but it should print as "Sum: 30.1" which takes some extra efforts. So here is what it asked for :) Please note concatenate happen only between str to str else it will through an error. Thank you so much Mosh for this wonderful tutorial :-) first_number = input("First: ") second_number = input("Second: ") add = float(first_number) + int(second_number) print("Sum: " + str(add))
10 minutes in and i already learned more than i did from my high school teacher
@aravindsrikarthigeyan10953 жыл бұрын
samee
@prabothmalsha40923 жыл бұрын
Sameee
@kirtanpatelium30653 жыл бұрын
@@prabothmalsha4092 more than just sitting there for an hour of 1 concept😂
@prabothmalsha40923 жыл бұрын
@@kirtanpatelium3065 😂😂😂
@sonishn52223 жыл бұрын
@@prabothmalsha4092 You learn python in highschool? wow
@Jack-b4l3w22 күн бұрын
17:50 or you can use a f string that combines intergers strings floats and booleans together into one string e.g. Print(f"I am {20} years old") Or in this case First = float(input("First: ")) Second = float(input("Second: ")) # we can get rid of the Sum variable print(f"Sum: {First + Second}" Feel free to copy and paste this code to test it Final notes • f strings can use strings intergers floats and boolean in one string • when using intergers floats and booleans in a f string make sure to use {} to separate them
@jocelynmin3 жыл бұрын
Thank you for this very informative video. Here is my progress so far... Exercise One age = 20 Status = ("New Patient") first_name = "Smith, Josh" is_online = False print(age) print(Status) print(first_name)
@SlenderBetty3 жыл бұрын
What’s the point of putting that “is_online=False Boolean factor in that though?
@omosumoru26533 жыл бұрын
@@SlenderBetty I think it was an error or she was just typing something else he mentioned
@dwaynefoxx72382 жыл бұрын
first_name = "John" last_name = "Smith" age = "20 " patient_status = "New Patient" print(first_name) print(last_name) print(age) print(patient_status)
@chicken78282 жыл бұрын
first = input("First: ") second = input("Second: ") sum = float(first) + float (second) print ("Sum: " + str(sum)) This is my basic Calculator coding when you gave us the little challenge I am proud to say that it was similar to yours thank you for this amazing free course
@myhatmygandhi62172 жыл бұрын
As a complete beginner I had no idea what to do 🤣
@SwoggersLOL2 жыл бұрын
Thats an amazing start dude! You can clean up your code even further by merging lines. ie: sum = float(input("First: ")) + float(input("Second: ")) print("Sum: ", sum) see its basically the exact same thing as what you have. but i saved space by immediately wrapping the returned string of Input inside the float and then immediately adding that to the sum variable. Then, instead of using + to concat strings, you can just use commas instead inside print statements. This is as advance as it really comes, and its totally optional. whatever it takes to solve the problem!
@rabia.bashir2 жыл бұрын
@@SwoggersLOL don't make it complex by cascading Keep it simple!! Here is mine: a = input("First: ") b = input("Second: ") sum = float(a) + float(b) print(sum)
@pineapplejuice11562 жыл бұрын
@@SwoggersLOL Good code but complex. Even though you are writing less code, it is very confusing to understand as for example, what if I added a third number to be added to the equation? I will have to be digging around in the complex code to add it in when I can just simply make a new variable which is easier to read and just do a "+=" to the sum.
@sandhyasamuel79432 жыл бұрын
@@rabia.bashir Yeah🙂 Khaby#Simple
@thebetterchannel-qd3kw4 ай бұрын
For the weight conversion exercise at 36:16- weight=input("Weight: ") weight_type=input("(K)gs or (L)bs: ") if weight_type=='k' or weight_type=='K': print("Weight in Lb: "+str(float(weight)*2.20462)) elif weight_type=='l' or weight_type=='L': print("Weight in Kgs: " +str(float(weight)*0.453592))
@nmsyahrianАй бұрын
I gave up on the weight conversion lol
@swayampattanaik15222 ай бұрын
excercise 2: w = int(input("Input your weight: ")) unit = input("Enter k for kg or l for lbs: ") if(unit=='k' or unit=='K'): res = str(w*2.2); print("weight in lbs: "+res) elif(unit=='l' or unit=='L'): res = str(w*0.45); print("weight in kgs: "+res) else: print("Please enter a valid input")
@Marcos-nl7el4 жыл бұрын
your english is really easy to understand for someone who is not a native speaker, thanks!!
@666Φ-σ4ε4 жыл бұрын
Hey.. Same here😅
@sarakamili67804 жыл бұрын
I agree 👍
@Linuxfy4 жыл бұрын
He hacking your brain with Python
@podonomonono61454 жыл бұрын
indeed
@omnamahshivay7614 жыл бұрын
Same here 😁
@rivirueren33832 жыл бұрын
15:08 no1 = int(input ("First :" )) no2 = float(input ("Second :" )) total = (no1)+(no2) print (total) 36:55 weight =input ('enter your weight' ) print ("Enter 'KG' for kilograms and 'L' for Pounds" ) unit = input ("KG or L" ) if unit =="KG" or "kg": print("Your weight is ,",(weight),(unit.upper())) else: unit == 'l' or 'L' print("Your weight is ," , (weight) , (unit.upper()))
@benjaminjohnpabroquez80122 жыл бұрын
How to program a calculator with if else statement weather you want addition or subtraction
@husse74in512 жыл бұрын
@@benjaminjohnpabroquez8012 num1= float(input("Enter first number: ")) op = input("Enter operator: ") if op == "+": print(num1 + num2) elif op == "-": print(num1 - num2) elif op == "/": print(num1 / num2) elif op == "*": print("invalid operator") There you go mate :)
@louisgalluzzo92842 жыл бұрын
at 15:08 this is how i put it because the way he does it or you did it makes it seem so complex and i ended up with the same as what you all got input("First: ") input("Second: ") sum = int(10) + float(20.1) print (sum)
@louisgalluzzo92842 жыл бұрын
what are your thoughts? is there a reason why it has to be more complex than it seemed?
@RosesForTheDead72 жыл бұрын
This is what i got as the result in demo printed "Sum: (result)" First = float(input("First: ")) Second = float(input("Second: ")) Sum = (First)+(Second) Result = str(Sum) print("Sum: " + Result)
@Mr.G1012 жыл бұрын
Hi. I am genuinely interested in learning Python and your videos are amazing. exercise numero 1: name = ("john Smith") age = 20 status = ("new patient") print(name) print(age) print(status)
@sh3ldox2602 жыл бұрын
or you could write print (name, age, status) but it works
@justaaccountforcommenting16502 жыл бұрын
@@sh3ldox260 but it would type all of it in the same line if u don't care about that then u can type it the way u said it
@IsaacOhiku-ix9tm3 ай бұрын
@@sh3ldox260 ohh I'll try this honestly didn't know 😅
@IsaacOhiku-ix9tm3 ай бұрын
Thanks I couldn't write the code😅
@miss_mia1Ай бұрын
36:27 Weight = float(input(“Weight: “)) Unit = input (“(K)g or (L)bs: “) if Unit == “L” or Unit == “l” print (“Weight in kg is: “ , Weight/2.2205) elif Unit == “K” or Unit == “k”: print(“Weight in lbs is: “, Weight * 2.205)
@sacthus3 жыл бұрын
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.
@peanutandginger53583 жыл бұрын
looooool!! Genius!
@Tiger_Labs_Code3 жыл бұрын
I made a Calculator that can add, subtract, multiply and divide=)
@juinaik80383 жыл бұрын
Lol
@rishithab60513 жыл бұрын
@@Tiger_Labs_Code great by seeing this video did u made it
@aardbeiwastaken3 жыл бұрын
@@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.
@sethsilber68893 жыл бұрын
I'm learning so I can teach my sister so she can pass her class.
@kaylahbunny3 жыл бұрын
that is so sweet of you :)
@sruthisammeta20593 жыл бұрын
Adopt me bro!
@sanjayuniyal95043 жыл бұрын
Wow u r so adorable bro❤️
@birdhumming5263 жыл бұрын
whaaaaat? Such a brother. You go champ!
@wopples38223 жыл бұрын
give this to your sister
@behindthebros32482 жыл бұрын
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.
@ZishanShaikh-p6n10 күн бұрын
The CODE for 14:56 is First_no = input("What Is Your First Number? ") Second_no = input("What Is Your Second Number? ") Num_1 = int(First_no) Num_2 = int(Second_no) result = Num_1 + Num_2 print("The sum of", Num_1, "and", Num_2, "is:",result)
@UB0NG3 жыл бұрын
As a programming newbie, I can say that this has simplified Python to a point that I am wholly interested. Awesome job, Mosh!!
@euroking13373 жыл бұрын
Wow ok Virgin
@pelomalino97153 жыл бұрын
@@euroking1337 tf
@levimagee24593 жыл бұрын
@@euroking1337 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
@egg25863 жыл бұрын
@@euroking1337 no need to project your sexual frustration on others
@mattjacobson36162 жыл бұрын
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?
@morhogeg4 жыл бұрын
Mosh is the best programming teacher on KZbin!❤
@hardeepkanaujia4 жыл бұрын
@@programmingwithmosh yes sir, you are my guru
@lokrajkoundal41754 жыл бұрын
@@programmingwithmosh sir , I was waiting for this only thanks but I saw the previous too. 2020 pythan
@sulemantasawar32654 жыл бұрын
I also agree with you
@neilyang29574 жыл бұрын
Me think Mosh is the best programmer teacher 👨🏫 too
@narendirank75014 жыл бұрын
@@neilyang2957 Absolutely. Mosh is the best. I am just 11 but now I know HTML,CSS, JavaScript,python because of Mosh😀
@NKCH-PM Жыл бұрын
hey, mosh! 2nd exercise: First = input("Enter the first number: ") Second = input("Enter the second number: ") Addition = float(First) + float(Second) print(Addition) O/P: Enter the first number: 10.1 Enter the second number: 22 32.1
@paranjay320611 ай бұрын
Thanks bro helped me out 😊
@tapatuti904711 ай бұрын
thanks!, was wondering why i was getting 55 from 1st number = 5 + 2nd number = 5
@usamanasir53472 ай бұрын
36:20 Weight Converter: # Weight Converter Exercise Weight = float (input('Enter your Weight = ')) Kg = Weight / 2.20462 Lb = Weight * 2.20462 Unit = input("It's in Lbs or Kgs ? ") # Double quotes are used so we can use apostrophe in a sentence if Unit.upper() == 'Lb' or 'l' or 'Lbs' : print('Weight in Kgs = ' + str(Kg)) elif Unit.upper() == 'Kgs' or 'k' or 'Kg' : print('Weight in Lbs = ' + str(Lb)) # OR we could use simple # else # print('Weight in Lbs' + str(Lb))
@gameverse-alchemy157 ай бұрын
36:57 my code is the one below, seems fine, works correctly weight = int(input("Whats Your Weight? : ")) type = input("(K)gs Or (L)bs? : ") if type == "K" or type == "k": a1 = weight * 2.20462 print("You are " + str(a1) + " lbs") elif type == "L" or type == "l": a2 = weight * 0.453592 print("You are" + str(a2) + " kgs")
5 ай бұрын
Here's what I went with: weight = float(input("Weight: ")) unit = input("(K)g or (L)bs: ") if unit == "K" or unit == "k": print("Your weight in pounds is " + str(weight * 2.2)) elif unit == "L" or unit == "l": print("Your weight in kilos is " + str(weight * .45)) print ("Have a nice day")
@pazecs5 ай бұрын
haha funny how i added the "have a nice day" too 😅
@nischalar20835 ай бұрын
Because u have only 1 more condition other than if.. u can type else instead of elif.
5 ай бұрын
@@nischalar2083 Thank you! That's very useful.
@Lokvie5 ай бұрын
Yours looks really good! Btw. you can use ''Variable.lower'' like I did in mine weight = int(input('Weight')) weight_question = input('(K)g or (L)bs: ') K = weight * 2.20462 L = weight * 0.453592 if weight_question.lower() == 'k': print(K) elif weight_question.lower() == 'l': print(L)
@Itsme-fv7ey4 жыл бұрын
emp = 35 if temp > 30: print ("its a hot day") elif temp > 20: # (20,30] print ("its a good day") elif temp > 10: #(10,20] print("its cold ") print("wear warm cloth") else : print ("stay home")
@mikethegamedev4 жыл бұрын
YEA!!!
@isaacvaz98194 жыл бұрын
if you want to make it more interesting, you can make the code so that you chose the temperature while runing the program, here's the code temp = int(input('enter temperature: ')) if temp > 30: print ("its a hot day") elif temp > 20: # (20,30] print ("its a good day") elif temp > 10: #(10,20] print("its cold ") print("wear warm cloth") else : print ("stay home")
@savingfoam79794 жыл бұрын
@@isaacvaz9819 Don't forget to add try and except.
@isaacvaz98194 жыл бұрын
@@savingfoam7979 yes your right thank u
@AerotaleYT4 жыл бұрын
covid = True If covid == True: print("Stay at home!")
@mr.roboleader91283 жыл бұрын
I am learning python because I'm an absolutely lazy leader, I absolutely hate doing repetitive tasks more than just once. Thank you so much for this walkthrough!
@moodyquixy73083 жыл бұрын
well u hate repetative shit? and ur coding ooof
@SynestheticAsylum2 жыл бұрын
Exercise 1: 9:00 first_name = "John" last_name = "Smith" age = 20 new_patient = True Exercise 2: 15:00 first = input("First: ") second = input("Second: ") print("Sum: " + str(float(first) + float(second))) Exercise 3: 36:00 weight = int(input("Weight: ")) unit = input("(K)g or (L)bs: ") if unit.upper() == "K": print("Weight in lbs: ~" + str(int(weight * 2.205))) elif unit.upper() == "L": print("Weight in lbs: ~" + str(int(weight / 2.205))) else: print("Invalid unit") For loops section 52:00 names = ["Sally", "Robert", "Bob", "Muhammed", "Li"] print(names) print(names[2]) names[2] = "Joe" print(names[2]) print(names[3:5]) names.append("Gerald") names.insert(5,"Honey") print(names ) print("test 1") for name in names: print(name) print("test 2") i = 0 while i < len(names): print(names[i]) i = i + 1
@faithamiani86392 жыл бұрын
Thank you for this
@sathishkumar1052 жыл бұрын
36:00 exercise is wrong he need the results in float not as int u had declared as int
@raywcksn2 жыл бұрын
I’m stupid. So i was confused with your second exercise. Why didn’t you do the code step by step? Like this: first = input(“first: “) second = input(“second: “) sum = int(first) + int(second) print(“Sum: “ + str(sum)) I’ve tried both your code and my code, both worked just fine. But, I’m intrigued, is there any specific reason why you didn’t do the code one step at a time? This is a genuine question.
@tkgellert2 жыл бұрын
@@raywcksn The only explanation for this is code length. If you are writing long and complex codes, you want to save some space. On the other hand, if you have a line full of operations instead of several lines made for the same purpose, your code can run faster (simply because your computer doesn't have to call a function and variables in each line, instead you have it called only once, and all operations are done at once).
@raywcksn2 жыл бұрын
@@tkgellert i see. Thanks for the explanation.
@bruhmndm3051Ай бұрын
15:01 First_number = input ("What is the first number? ") float (First_number) Second_number = input ("What is the second number? ") float (Second_number) print ("First: ",float (First_number)) print ("Second: ",float (Second_number)) Sumtotal = float (First_number) + float (Second_number) print ("Sum: ", Sumtotal)
@Akhan4u3 жыл бұрын
Excellent Course. No distraction, No crap. Just explained with so much ease and comfort. Makes so much sense for every minute of the hour!!!
@Finfunmermaid3 жыл бұрын
number = input("Enter your number: ") Number = input("Enter your second number: ") Answer = int (number) + int (Number) print (Answer)
@abhirajx17103 жыл бұрын
THERE ARE A FEW ERRORS THERE • _Both variables are named 'number'_, you could have used something like _num1_ and _num2_ • This calculator is unable to calculate _the sum of floating decimals_ , you better change those int() with *float()* • _Your code has to be little more formatted_ ... *• All the best, keep trying ✔️👍🏻🤘🏻*
@nyuktaxs6372 жыл бұрын
15:07 first_number = input('First: ') second_number = input('Second: ') first = float(first_number) second = float(second_number) print('Sum:', first + second)
@TechGamerzRapidGaming16 күн бұрын
9:05 Here you go. This is what script I wrote for first exercise: Patient_Name = 'Name = John Smith' Age = ('Age = 20 years old') New_Patient = True print(Patient_Name) print(Age) print('New Patient =',New_Patient)
@f1memelord722 жыл бұрын
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.
@ImMo12562 жыл бұрын
8:50 last_name = "Smith" first_name = "John" age = 20 patient_status = "New" print(last_name,first_name,age,patient_status) 14:50 first = input("Add two numbers. First: ") second = input("Second: ") sum = int(first)+int(second) print("The sum is", sum) 36:26 weight = float(input("Let's convert your weight! How much do you weight? ")) unit = input("Is that in (K)g or (L)bs? ") if unit.upper() == "K": print("In pounds you weigh: ", weight * 2.21) if unit.upper() == "L": print("In kilograms you weigh: ", weight * 0.45) else: print("Error, please try again.") print("Have a nice day!")
@frems8812 жыл бұрын
Last one is wrong, you typed twice "if", should be if/elif/else :)
@aidenlakata76622 жыл бұрын
bruh that weight converter had me stumped xD
@frems8812 жыл бұрын
@@aidenlakata7662 Trust my man, I have problem with if, elif for 1hour because of one space bar 😂
@aidenlakata76622 жыл бұрын
@@frems881 I started last night and have problems with it all😂
@Angelo-ux2it2 жыл бұрын
just finished mine and came to check it out the answers. good call using the upper() function. Way nicer than what i had { x = "k" or x = "K" }
@ΤζαννηςΜακρογιαννης9 ай бұрын
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))
@leonaise75467 ай бұрын
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!
@TheWanderingHeather7 күн бұрын
As someone who has not done any programming courses I found this incredibly informative and easy to follow. Thank you very much!
@vinling27672 жыл бұрын
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.
@giovannisita93423 жыл бұрын
This is probably the best Python Beginner Course I've come across.
@thereadinguy6843 жыл бұрын
Me too I learn from whit hat junior but they don't teach any scripting but this is the video that can help me a lot learn about python
@themuffincat3 жыл бұрын
@@thereadinguy684 whitehat is a scam
@nerokyi8 ай бұрын
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))
@hiraeth73165 ай бұрын
Thank you. I was confused on how to do it and your comment helped me
@imtheguywhoasked5 ай бұрын
You're a g.
@ClashZone-h9w19 күн бұрын
full_name = input('Enter full name: ') age = input('Enter age: ') new_pateint = input('New or Existing pateint?') print(full_name) print(age) print(new_pateint) print(full_name, ", thank you for your registeration!") This was one of my very first lines of code that I wrote!! Also TY Mosh for your guidance!
@studgraphics33003 жыл бұрын
People out there making clickbait videos, while this legend is making an hour video teaching us all python. thank you so much!
@Pointwood9911 ай бұрын
You're awesome Mosh! Thank you. Exercise 1: name = "John Smith" print("Name:", name) age = 20 print("Age:", age, "Years old") newcomer = True print("Newcomer?", newcomer) Exercise 2: first = input("First: ") second = input("Second: ") sum = float(first) + float(second) print(sum) Exercise 3: #Input weight = input("Weight: ") #K or L KL = input("(K)g or (L)bs: ") #if K if KL.upper() == "K": Kg = float(weight) / 0.45 print(Kg, "Lbs") elif KL.upper() == "L": Lbs = float(weight) * 0.45 print(Lbs, "Kg")
@joshua-76389 ай бұрын
Hey I know I'm a bit late but for exercise 2 on Ur 3rd line of code, u wrote float(first). When I did this exercise I wrote int(first) by any chance can u explain what the difference would be because my code ended up working but we got different solutions, cheers 👍🏼
@joshua-76389 ай бұрын
nvm mind just watched like 1 more minuet of the video and the bloke wrote int aswell, interesting how Ur solution work aswell
@vegemitetoast52019 ай бұрын
@@joshua-7638 just to answer your question anyway, a float is a number that includes decimals e.g 2.2123, an int is any whole number e.g 2,3, or 4.
@vivasvan18188 ай бұрын
um u said that instead of float it should be integer instead of integer he wrote float that will good because if the user writes something like this First:1 Second:2.4 it show error if he writes int() @@joshua-7638
@TainoGen8 ай бұрын
I want to learn cuz i want to create a program for my children. Ive had a brain injury during a deployment an i find it very difficult to express my thoughts. An i feel if i can create a virtual environment where i can express and leave some learning experiences they might understand me a bit better 😊
@RainSage5 ай бұрын
I hope you get to where you want in it I’m taking my last class with the python programming in it and I get my associates then going to free code camp to get my certificates in Java , Java script and web development for a better job , before pursuing my bachelors
@noonenoone57485 ай бұрын
Meanwhile AI can code faster than any human alive. AI needs no sleep. Works 24/7. Works for free. Human obsolete 😪
@RainSage5 ай бұрын
@@noonenoone5748 yea but it doesn’t complete a lot of different codes like arrays sometimes it messes up so still that’s run people are still getting jobs in that field