Operators in Python #5

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

Комментарии • 134

  • @programizstudios
    @programizstudios  2 года назад +5

    🔥Finding it Damn Hard to Understand Python?
    Learn to code-the right way-with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT!
    Try Programiz PRO for Free: bit.ly/interactive-py

  • @programizstudios
    @programizstudios  4 года назад +35

    Due to some technical issues and ongoing lockdown, the 4th video in the series is delayed. We will upload the video soon.

  • @cadjiton
    @cadjiton 3 года назад +19

    i love the way he is teaching it. i knew nothing about python a day ago, and now i know many things about it, only watching these videos. Great work👍👌. Thank you Programiz!!!!

  • @Legend-gu8uz
    @Legend-gu8uz 3 года назад +9

    km = input("Enter number : ")
    km = int(km)
    print (km, "is equal to" ,0.621371 * km)
    This is the program to convert Km into miles

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

      thanks for the help
      Based on what you shared I did this
      print (km, "km", "is equal to" ,0.621371 * km ,"miles")
      Just to add the details :)

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

      @@SugoiTots
      kilometer_travelled = int(input('enter the kilormeters travelled : '))
      kilometer = 1
      miles = 0.621371
      kilometer = miles
      miles = miles*kilometer_travelled
      print('miles travelled is',miles)

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

      use "float" remove "int"

  • @lordmuzan_989
    @lordmuzan_989 4 года назад +14

    your c tutorials helped me a lot.
    python tutorials is great.
    thank you sir
    for helping my career.

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

      Thank you for your kind words. We are glad to know our tutorials were helpful for learning and are helping you build your career.

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

      are the c tutorials online anywhere?

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

      @@ayushidhamane9681 there is an app from them to learn C
      link for android:
      play.google.com/store/apps/details?id=com.programiz.learnc

  • @kartikudainiya2328
    @kartikudainiya2328 3 года назад +5

    I am in class 10th learning python for my new subject AI(Artificial Intelligence) and I often learns from this channel and since my laptop is of old version his website helps me to use, compile the python programming thank you so much

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

    I just started learning programming and have been through numerous tutorials and videos scouring the internet for something that's in depth and will teach me what I need to know and go into detail. This Programiz course is the only one that's teaching the basics like they need to be taught. Thank you, good sir, looks good on ya!

  • @sharmaji-ez2uv
    @sharmaji-ez2uv 3 года назад +4

    hey ! your video helped me alot ! i created the converter of km to miles ! it was just out of the world felling when code worked well ! thanx alot guys .........and those who are still trying ...dont worry you are better than me :D

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

      its * feeling* mate anyways we all make mistakes so no worries👍😜

  • @emilydunbar5107
    @emilydunbar5107 3 года назад +2

    You're a life saver. My programming teacher has a hard time explaining things.

  • @goonjt6253
    @goonjt6253 3 года назад +2

    Today I'm so happy..successfully written my first program.Thanks so much Sir #Programiz 🙏🙏..

  • @rajeshbanala.rb1
    @rajeshbanala.rb1 4 года назад +4

    Best python video tutorials ever...HeartfullyThank you so much sir 💓 .....

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

      Thanks for sharing your thoughts. We are delighted to hear that our team is able to provide you with the best Python learning tutorials.

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

    I actually love you thank you so much because I know my grades are going up after watching your series

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

    Great Video tutorial, Also discusses some practice questions at end which helps in practice, I hope this practice of assignments will be continued in future topics as well.

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

      Thank you! We are glad you loved our Python tutorials along with our practice questions at the end that you found helpful. We will try to continue that in the future as well.

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

    It’s a always nice to watch your videos. I’m sure if you’re a teacher, no student will fail in your class. Kudos 👍🏾👍🏾

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

    This series is the best thing ever. I have needed an easy and fast way to learn coding in ython. You guys are amazing and I need you to kee it u.

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

    hey python god
    how is your day goin
    cuz of you here in my 12th class my day just passed like I am a hero

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

    Learning Python is something you would like to get in your skills, but you do not know where to start? This NEW channel will help you out leaning Python Programming from scratch - for complete Beginners, Intermediate and Advanced Levels

  • @BrokeCanadian
    @BrokeCanadian 3 года назад +2

    11:00 I could be wrong but I don't think the parentheses is only to make code more readable.
    BODMAS means the brackets can affect the result.
    For example:
    34 * (5 -15) = *-340*
    34 * 5 - 15 = *155*

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

      Yeah, parentheses are not the only way to make our code more readable. However, there are certain situations where it's better to use parentheses. For example,
      5 - 15 % 3 = 3
      It may not be apparent here which operator runs first. In such cases, we can use parentheses.
      5 - (15 %3) = 3
      By the way, the order of execution of operators is determined by the "precedence and associativity of operators". If you want to learn more about it, you can check this article: www.programiz.com/python-programming/precedence-associativity

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

    Awesome job Programiz!! Love your videos
    #convert 564.5 kilometeres to miles
    distance_km = float(input('kilometers travelled:',))
    kilometers_per_miles = float(1.60934) #1km = 1.609
    distance_miles = ( distance_km / kilometers_per_miles)
    print(distance_miles, 'Your travelled in kilometers')

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

      distance_in_km = float(input('enter the distance in km ='))
      distance_in_miles = distance_in_km *0.6213171
      print("the distance in miles is ",distance_in_miles)

  • @Dr.AbrarUts
    @Dr.AbrarUts 3 года назад

    Best Python tutor 👍

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

    You are my favorite teacher

  • @thelegendarysummersky3189
    @thelegendarysummersky3189 7 месяцев назад +1

    # 1 km = 0.621371 miles
    miles = 0.621371
    distance_km = 564.5
    distance_to_miles = distance_km * miles
    print("564.5km to miles: ",distance_to_miles)

  • @user-vm5xk6sw7d
    @user-vm5xk6sw7d 8 месяцев назад

    kilometer = int(input("input the distance covered in kilometers: "))
    miles = kilometer * 0.621371
    print("miles covered is equal to {} miles".format(miles))

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

    distance = int(input('Enter the distance in km: '))
    distance_in_miles = (distance * 0.621)
    print('Distance in miles is :', distance_in_miles)

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

    3:55 this part literally helped me out lmao, my dumbass have been using "^" instead of "**". Thanks a lot man!

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

    He is very good in explaning python

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

    to find the amount of fees after discount in dynamic form is :
    a=float(input("enter the amount of fee:"))
    b=float(input("enter the amount of discount:"))
    c=(b/100)*a
    d=a-c
    print("the total amount of fee should be payed includind discount will be :",d)

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

    By the way, you can also do x *= 5 to say x = x * 5 and also x /= 5 to say x = x / 5.

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

    Thank you very much for this series! very helpful for the starters! :D

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

    km = int(input("Enter kilometer: "))
    convert = (km * 0.621371)
    print(km, "km converted into miles is:" , convert)
    My code for the km to miles converter. P.S I'm just 13 and tryna get into coding so don't bully me if my code is bad 😶

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

    print("I have to pay $",4535*0.9," in tuition fees for the next semester", sep="")
    #or
    print(f"I have to pay ${4535*0.9} in tuition fees for the next semester")
    Yeah, it's not dynamic, and hard coded, but also easier and faster. For km, just do the basic input + int cast km, then multiply that amount by 0.6whatever and you have your miles.

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

    km_travelled=float(input('Enter the distance travelled :))
    km=1
    miles=0.621371
    km=miles
    miles=km_travelled*km
    print("distance in kilometers to miles is:", miles)
    O/p-
    Enter the distance travelled:564.5
    distance in kilometers to miles is:350.7639395

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

    I have a question, I have created an operator as a button and placed it on my custom panel, but now I want to know if the button is pressed. I don't know how would I do that. Any example?

  • @MYSTIX.01
    @MYSTIX.01 2 года назад

    You guys are really helpful 😊 I appreciate it

  • @sanaln4181
    @sanaln4181 10 месяцев назад

    km=float(input("Enter distance :"))
    miles=0.621371
    distance_miles=km*miles
    print("Distance travelled in miles is:", distance_miles

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

    i have done task
    it's working

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

    Thank you for the free lesson

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

    i hope this is ok
    thank you for your tutorials !!
    distance_km = 564.5
    kilometer = 0.621371
    distance_miles = kilometer * distance_km
    print(distance_miles)

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

    to convert distance in kilometers to miles
    #1km = 0.621371 miles
    kilo_meters= 187
    distance= kilo_meters*0.621371
    print(distance)

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

    Thanks

  • @DeepakKumar-xd7qf
    @DeepakKumar-xd7qf 3 года назад +1

    #Converting distance in km into miles
    Distance_in_Kilometres=int(input('Enter the distance in km: '))
    Distance_in_Miles=Distance_in_Kilometres*0.621371
    print('Required distance is ',Distance_in_Miles,'miles')

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

      Your codes nice :)
      It only runs on whole number cause its int :)

    • @DeepakKumar-xd7qf
      @DeepakKumar-xd7qf 3 года назад +1

      @@SugoiTots Thanks

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

    sir plz tell me what is use of "x" (1:20) ???
    why you wrote "x" ???
    why to write it ???

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

    I'm enjoying following your videos 10/10 marks, I find them very intuitive and easy to follow, awesome job. However, Where is video #4 please? Thanks

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

      Thank you! We appreciate your thoughts. It really helps us to keep going and delivering the best videos for learning Python.
      Due to some technical issues and ongoing lockdown, the 4th video in the series is delayed. We will upload the video soon. Stay tuned :)

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

    Distance_km = 564.5
    Miles = 0.621371
    Print(“564.5 Kilometers is”, distance_km*mikes, “miles”)

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

    The answer to the task
    Km=int(input("Enter "))
    print(" miles is" , Km * .621371)

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

    I love you man

  • @00Shinigami00
    @00Shinigami00 2 года назад

    Awsome teaching

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

    great tutorial and easy to follow

  • @MYSTIX.01
    @MYSTIX.01 2 года назад

    Use to understand

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

    I hope this is ok!
    Thank you for your lessons! These are so helfpul!
    >>> distance_km=564.5
    >>> #1 km=0.621371 miles
    >>> distance_miles = 564.5 * 0.621371
    >>> print(distance_miles)
    350.7639295

    • @programizstudios
      @programizstudios  3 года назад +2

      Your code works, however, you have haven't made the use of distance_km variable. Something like this:
      distance_km = 564.5
      km_miles_ratio = 0.621371
      distance_miles = distance_km * km_miles_ratio
      print(distance_miles)

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

      @@programizstudios oh...thank you!!! 😁

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

    is that correct program? let me know if i wrong and give me the feedback
    a=0.621371
    b=float(input("Enter the distance number in kilometeres:"))
    miles=b*a
    print("You have reach",miles,"miles")

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

      Nice. Your solution is correct.
      I have a suggestion though. Try to give descriptive variable names instead of a and b. Something like km_miles_ratio, distance_km etc.

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

    Excuse me sir
    5 ** 2 = 25 ❓
    5 ** 2 = 125 is it wrong?????
    I can't understand

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

    what is the operator " ^ " use????

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

    awesome tutorial
    too good

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

    nice explanation

  • @user-vc8uz5zk5t
    @user-vc8uz5zk5t Год назад

    distance_km = int(input())
    distance_mile = km * 0.621371
    print(distance_mile)

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

    I kinda don’t like there app but I like the videos

  • @Project.i
    @Project.i 5 месяцев назад

    #program to convert km into miles
    kilometer = float(input("enter the kilometer to convert it into miles:"))
    # 1km equals 0.621371 miles
    Miles = (kilometer * 0.621371)
    print("The entered kilometer in miles:", Miles)

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

    Bro where is your 4th video

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

      We are sorry but due to some technical issues and ongoing lockdown, the 4th video in the series is delayed. We will upload the video soon.

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

      @@programizstudios ok we can understand

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

    kilometer_travelled = int(input('enter the kilormeters travelled : '))
    kilometer = 1
    miles = 0.621371
    kilometer = miles
    miles = miles*kilometer_travelled
    print('miles travelled is',miles)

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

    I don't understand from where 567.5 came in the programming test because it isn't in the question "_"

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

    can u tell me how to do the question u asked the kilometer to miles. please i am not getting it and i cant find the thing where you told the answer was pls

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

      Hello Jayashree,
      You can find the answer using the link on the video description. Just follow the link under "Programs in this video" section and click on it. Our github page will open up where you can scroll to the bottom of the page to view the answer.

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

    miles=0.62137
    km=25
    kim=km*miles
    print(km," kilometres in miles:",kim)

  • @BigBoss-qh4xr
    @BigBoss-qh4xr 3 года назад

    distance_kms = input("Enter distance in Kilometers:")
    distance_miles = (distance_kms / float(1.609))
    print("Distance in miles: ", distance_miles)
    Tried to write a script which returns the value in miles and accepts user input, but its not working.

    • @programizstudios
      @programizstudios  3 года назад +2

      It's because the input() function takes input in string format. You need to change it to a number before you can perform arithmetic. Something like this:
      distance_kms = float(input("Enter distance in Kilometers: "))

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

    My code is better as it transfers any number in kilometers into miles instead of only 564.5
    '''This Program Converts Kilometers into Miles'''
    km_distance_input = float(input("How long is the distance in kilometers?:"))
    conversion = km_distance_input * 0.621371
    print("From KM to MILES it is:", conversion, "miles")

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

      There are many approaches when it comes to solving :)
      Yours is one of them :)
      Thank you for sharing.

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

      @@SugoiTots thanks for replying and yes that's true:)

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

    distance_km=564.5
    distance_mile=0.621371
    distance_in_mile =(distance_km*distance_mile)
    print(distance_in_mile)

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

    My program for the task:
    km = int(input("Enter KM: "))
    miles_distance = (km * 0.621371)
    print("Km to miles is: ", miles_distance)

    • @ozansen.8870
      @ozansen.8870 3 года назад

      but shouldn't you use float instead of int?

  • @kushal-shaw-pvt
    @kushal-shaw-pvt 3 года назад +1

    Sir please teach tkinter

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

    #Addition
    print(" ADDITION ")
    x = input("Enter First Number")
    y = input("Enter Second Number")
    print("The Answer Is", x + y )
    .
    .
    when i execute this code, the thonny ide and the programiz Online Python Compiler add the number like (2+2=22) and not (2+2=4) i can't understand where the problem is....
    Can any one pleaseeeee help me ..........

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

      You are getting this error because python initializes its input values as string type. Hence, when you add strings, you concatenate them and thus, you are getting 2+2=22
      Try converting them into integer type by introducing
      x = int(input("Enter First Number"))
      y = int(input("Enter Second Number"))
      print("The Answer Is", x + y )

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

      @@vedangranmale2865 thankyou for the answer🥰🥰....but i already got the solution from programiz website...

  • @-A-VikasBalaga
    @-A-VikasBalaga 2 года назад

    Isn't there a hierarchy of operators in python like it is in C language?

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

    Great video, thanks again.
    In 8:59 - How about writing - "discount = 10/100" - except for "discount_percent = 10"? I got the same answer after running the program. Have I done anything not right?

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

      nah bro you haven't , its just you have written the variable data early , he wrote the variable 10 just to make it eazy to understand

  • @riabid-me3lt
    @riabid-me3lt Год назад

    distance_km =564.5
    #1_km = 0.62 miles
    distance_miles = (distance_km / 0.62)
    print(distance_miles)
    Your explanation is amazing!❤

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

    wait................................ so how does x=x+10 work(illegal equation)

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

    How can I calculate a square root?

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

    Sorry if I'm wrong, I'm new to this but...
    Can you do the tuition in four lines instead of five?
    fee = 4535
    discount = fee / 10
    discounted_fee = fee - discount
    print(discounted_fee)
    And this for the task:
    distance_km = 564.5
    mile = 0.621371
    distance_miles = distance_km * mile
    print(distance_miles)

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

    How to make web on computer to use pythan

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

    I got the answer.
    The answer was 350.7639295 miles. Am I write??????

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

    # 1 KILOMETRE = 0.621371 MILES
    distance_km = 564.5
    miles = 0.621371
    km_to_mile = (distance_km*miles)
    result=(km_to_mile)
    print(result)

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

    # Taking input of kilometer
    km = int(input("Enter the number in km: "))
    # 1km = 0.631371 miles
    mile = 0.621371
    # Multiplying the values
    ans = int(km) * mile
    # Printing the answer
    print("The Answer is: ", ans)
    .
    .
    .
    code to convert km to miles;)

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

    😀

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

    """THIS PROGRAM TO FIND A DISTANCE IN KILOMETER TO CONVERT IT TO MILES"""
    Distance_kilometer=250
    per_Kilometer=0.621371
    DISTANCE_MILES=Distance_kilometer*per_Kilometer
    print("a distance in kilometer to miles for 250 kilometer is",DISTANCE_MILES)
    SIR I RUN THIS PROGRAM IT IS CORRECT OR WRONG SIR

  • @aritradey7189
    @aritradey7189 2 года назад +1

    distance_km=564.5
    # 1.00 km= 0.621371 mi
    distance_mi=distance_km * 0.621371
    print("Distance in Miles: ",distance_mi)

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

    oh

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

    3:11

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

    from thailand i want subtitle thai pls

  • @almaan.7202
    @almaan.7202 4 года назад +2

    OKJust I am the first commenter I can't understand how to add loops

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

      for i in range(5):
      print(i)

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

      i = 0
      while i

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

      Hi Almaan, we are posting our while loop video next week. Please stay tuned. For the time being, you can go to our website to learn more about Python for and while loops.

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

    10:07 it was easy ;)
    distance_km = float(input("km:"))
    # 1 km = 0.621371 miles
    distance_miles = distance_km * 0.621371
    print(distance_km ,"km =",distance_miles,"miles")
    just copy paste the code

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

    pls make sure you increase your audio volume

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

    answer of the question is 350.83903045369794

  • @user-pk5kr6fv2s
    @user-pk5kr6fv2s Год назад

    distance_in_km=int(input("enter the distance in km:"))
    miles=distance_in_km/0.621371
    print(miles,"miles")