Implicit Type Conversion in Python

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

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

  • @KISHANKUMAR-h8v2n
    @KISHANKUMAR-h8v2n Год назад +8

    TypeError Traceback (most recent call last)
    Cell In[9], line 4
    2 y = 20
    3 total = x + y
    ----> 4 print("The total is: " + total)
    TypeError: can only concatenate str (not "int") to str

  • @rajeshprajapati1851
    @rajeshprajapati1851 Год назад +12

    They really mean it when they say "in details".

  • @Jbergawane9
    @Jbergawane9 Год назад +9

    >>> x=10
    >>> y=20
    >>> total = x + y
    >>> print("the total is: " + total)
    Traceback (most recent call last):
    File "", line 1, in
    TypeError: can only concatenate str (not "int") to str

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

      Yeah only with int multiple char
      Or int multiple int
      Or char plus char
      Or making a int string by adding quotation and add them...❤
      Hope it helps ❤❤

    • @kaus05
      @kaus05 3 месяца назад

      implicit type conversion does not work with ambiguous input such as in case of string concatenation for avoiding scenarios such as
      what should be the output in case of '5' + 5

    • @asahade3847
      @asahade3847 2 месяца назад

      I don't understand

  • @iamskatif
    @iamskatif 9 месяцев назад +3

    Not one of the best, the One best channel ❤

  • @davidsethathi7188
    @davidsethathi7188 10 месяцев назад +2

    x = 10
    y = 20
    total = x + y
    print("The total is: " + str(total))

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

    Your videos are really helpful. Kindly Please complete the DBMS series taught by prabhu subramanian. Thanks ❤️❤️

  • @314_vaibhavshukla7
    @314_vaibhavshukla7 Год назад +4

    yesterday i finished from 1 to 11
    today i finished it till 32 , and the process is still going on...!
    i 'will comment it again.

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

    it will be error because we can't just add directly str and int value. please correct me if I'm wrong

  • @achugh52
    @achugh52 24 дня назад

    we cannot concatenate string and number in print statement. we need to place a comma before + total

  • @fantasycollection5383
    @fantasycollection5383 11 месяцев назад +1

    suppose if there is 5.98+10 then it should be 15 according to rule of conversion

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

    sir plese upload quikly as possible we are eagerly waiting

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

    Sir please continue C++ series......

  • @SamuelGselassie
    @SamuelGselassie 9 месяцев назад +3

    x = 10
    y = 20
    tot = x + y
    print("The total is: " + str(tot))
    'The total is: 30'

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

    What is higher data type and what is lower data type

  • @GaddamPrakash-j8b
    @GaddamPrakash-j8b 11 месяцев назад +1

    Output=the total is :60

  • @AshutoshSingh-ht8st
    @AshutoshSingh-ht8st 3 месяца назад

    ERROR!
    Traceback (most recent call last):
    File "", line 4, in
    TypeError: can only concatenate str (not "int") to str
    === Code Exited With Errors ===

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

    error . sting is not concatenated with int type

  • @navyaswarup9573
    @navyaswarup9573 11 месяцев назад

    Error, as string and int can't be sum together.

  • @AshutoshSingh-ht8st
    @AshutoshSingh-ht8st 3 месяца назад

    And the solution is to remove concatenation sign from total
    And put a comma before it

  • @seekers-path
    @seekers-path Год назад

    output: The Total is: 30

  • @BabitaGhalley-d6t
    @BabitaGhalley-d6t Год назад

    output: The total is: 30

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

    ❤❤

  • @hamzabenhaddou6240
    @hamzabenhaddou6240 11 месяцев назад

    why not 16 instead of 15

  • @tharunkumar8430
    @tharunkumar8430 9 месяцев назад

    I got an error. But in JAVA compulsory it won't get an error

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

    30

  • @aman_maurya7.
    @aman_maurya7. 15 дней назад +1

    Class 11 CBSE
    Computer Science students ❤

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

    Error

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

    Type error

  • @dejendegu2102
    @dejendegu2102 10 месяцев назад +1

    'The total is:+ 30'

  • @arifansari5671
    @arifansari5671 8 месяцев назад

    >>> x = 10
    >>> y = 20
    >>> total = x + y
    >>> print("the total is: " + total)
    Traceback (most recent call last):
    File "", line 1, in
    TypeError: can only concatenate str (not "int") to str

  • @ahmadfarhadzammani5261
    @ahmadfarhadzammani5261 6 месяцев назад

    x = 10
    y = 20
    total = x+y
    print("the total is: "+ str(total))

  • @sambasivaNaturelover3399
    @sambasivaNaturelover3399 6 месяцев назад

    x=10
    y=20
    sum=x+y
    print("The total is: "+str(sum)

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

    30

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

    30