For Loop in Python (So Easy to Understand) #9

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

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

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

    🔥 Learn Python with a more hands-on experience with Programiz PRO-interactive lessons, quizzes & challenges.
    Try Programiz PRO: bit.ly/right-python

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

    Hey Guys! At 0:45, there is a minor error on our part. "Python" is a sequence of 6 characters, not 7.

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

      No its true. PYTHO&N

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

      I count 7 characters in my sequence
      "Python🐍"

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

      @Zak MB If you just increment start value by 1, you will get the answer:
      n1=int(input("Enter number1: "))
      n2=int(input("Enter number2: "))
      print("The numbers between them: ")
      for i in range(n1+1,n2): #The number starts from n1+1 and n2 is excluded by default
      print(i)

  • @SpodermanISLoVe
    @SpodermanISLoVe 3 года назад +13

    This channel is really underrated, such good content.

  • @otatop7359
    @otatop7359 4 года назад +22

    i know i am late in this video but i just started learning from yesterday and i am catching up pretty fast thanks to you guys. I was learning c from the website back then too.

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

      This code isn't correct in answering the video's question. Look at the example he gives in his link if you haven't already.

  • @HariPrasad-mn5vu
    @HariPrasad-mn5vu 3 года назад

    Guys if u want to learn python this is the best content some one can give you this can even compete with paid course worth a thousand dollar. Glad got a teacher like you thanks for the videos

  • @hamburguesete
    @hamburguesete 4 года назад +19

    Great video ! I love the way you explain evereything, it all makes sense. Keep up the great vídeos ! I have a small feedback, I know that every video you teach us a new tool of programing that opens up a whole new universe of small projects that we can do to get better, and at the end of the video you give us a smal project "homework" but its always very oriented in training that specific tool, i think that at the end of every video you should give us 3 small but yet challenging projects that we will use everything that we learned until that point. Thank you so much for the awesome content, and i hope you understand what im saying.. im sorry for the bad english.. Much love from Brasil !! 🇧🇷👍

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

      True, We need some challenging one's

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

      Hi Raphael! Good to know that you are enjoying our videos. We will take your feedback into consideration while creating new videos. Thanks.

  • @sauravsingh9795
    @sauravsingh9795 2 года назад +7

    for i in range (1, 100):
    print(i, "+", end=" ")
    print(100, end=" ")
    print("=", sum (range(1,101)))

    • @SharkSnuggie
      @SharkSnuggie Год назад +2

      A much easier way to do it is:
      sum = sum(range(1, 101))
      print(sum)

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

      @@SharkSnuggie sum is a built in function and you can use it as a variable?? dang.. that's crazy.

    • @adheeshakaumadi
      @adheeshakaumadi 8 месяцев назад +1

      @@chomeboy yes you can use it as a variable

    • @RishabhMall-s1z
      @RishabhMall-s1z Месяц назад

      ​@SharkSnuggie easier way:
      n=100
      print(n*(n+1)/2)

  • @irynahryma2605
    @irynahryma2605 Год назад +2

    Thank you for your lessons! You 're explaining really very good. I solved the task,you gave at the end of the video and I was excited, when it ran and everything was correct.

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

    Highly underrated channel, thanks a lot pal!

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

    7:23
    n = int(input("enter the limit"))
    i=0
    j=1
    for i in range (0,n):
    sum = i+j
    i= sum
    j= sum+1
    print(sum)

  • @enzymatic1
    @enzymatic1 3 года назад +12

    total = sum(range(1, 101))
    print(total)
    Easy way to do it in just 2 lines using the sum() function. Though its a shortcut that doesn't use a for-loop obviously.

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

      Figured it out
      ' ' '
      number = 1
      total = 0
      for number in range(1,101)
      total = number + total
      print(total)
      ' ' '
      Not too bad, but a little brain tease.

    • @Priyanshukumar_48
      @Priyanshukumar_48 2 года назад +6

      Just liten carefully whatever sir told
      We have to print the result in such format that it is like
      Result=1+2+3+4+............+100
      Not the sum of all those number

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

    I wrote this!!
    # Sum of any range of numbers
    a = int(input("Input the first number in the range: "))
    z = int(input("Input the last number in the range: "))
    sum = 0
    for i in range(a , z+1):
    sum += i
    i += 1
    print(sum)

  • @letstry2854
    @letstry2854 4 года назад +6

    Thanks sir 👍
    Keep uploading...I am regular viewer!!

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

    This was the first video I saw, and it was very much useful. And this is not the last video. Now I am gonna watch the complete playlist. Thanks. And keep uploading

  • @malikcimen740
    @malikcimen740 4 года назад +8

    thaks a lot everything clearer than my professor's telling xD

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

    You are a genius and a great professor! Thanks a lot!

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

    Your video's are very nice you explain it very nicely i made soo many programs on python by only watching your video it helped me alot Thank you bro

  • @125-ronaka7
    @125-ronaka7 3 года назад +2

    loved the way of teaching , as well as the content

  • @GTheo.
    @GTheo. Год назад

    Man you are born to teach.. even a 5 years old can understand you..

  • @Aravindblaze95
    @Aravindblaze95 5 месяцев назад +1

    sum = 0
    for numbers in range(1,101):
    sum = sum + numbers
    print(sum,"=",end=" ")
    for number in range (1,100):
    print(number,"+",end=" ")
    print("100", end=" ")

    • @Aravindblaze95
      @Aravindblaze95 5 месяцев назад +1

      Output:
      5050 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100

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

    So simply explained. Unbelievable. Thanx boss!

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

    idk if you'll ever see this comment python sensei but i want you to know you deserve great things in life your videos have helped me so much in my learning journey

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

    def numsum():
    sum=0
    for current_number in range(0,101):
    sum = current_number + sum
    print(sum)

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

    for loop in range (1,100000):
    if loop == 1:
    num2=0
    num1=num2
    num2=loop+num1
    if loop ==100:
    print(num2)

  • @rock8938
    @rock8938 3 года назад +7

    sum=0
    for count in range(1,101):
    sum=sum+count
    print(sum)

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

    Awesome lecturing brother 👍👍

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

    n = int(input("Enter a number:"))
    for c in range(1, 11):
    p = n * c
    print(c,"x",n,"=",p) this is my first tables code with for loop and I've done it without seeing the real code

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

    number = range(1,101)
    For a in number:
    print (a,"+",end="")

  • @স্টোরিলিন
    @স্টোরিলিন 3 года назад

    total = 0
    # looping for summation of any series "x" to "y"
    x=int(input("enter the lower range : "))
    y=int(input("enter the upper range : "))
    for number in range(x,y+1):
    total = total + number
    print(total)

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

    sum_num = 0
    for i in range(1, 101):
    sum_num = sum_num + i
    print(sum_num)

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

    Great video👍, the way of your explanation is very good👌, all concepts are clear.

  • @ArunKumar-zz4tg
    @ArunKumar-zz4tg Год назад

    Awesome Explanation Brother

  • @gabrielladangler1722
    @gabrielladangler1722 4 года назад +5

    Great videos! You've made it easy to learn Python, especially coming from a background in C. I do have a quick question: towards the beginning of the video, you say that the string 'Python' has 7 characters. Does this include a null character, or was this simply a mistake? Thank you! :)

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

      Oh! It's an error on our part. "Python" is a sequence of 6 characters, not 7. And, they do not end with the null character like in C programming.

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

      @@programizstudios Thank you for the clarification! :)

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

    using range function:( i did it myself so I didn't see what was coming)
    number=int(input("Enter the number:"))
    for count in range(1, 11, 1):
    product=count*number
    print(count,"x", number,"=", product)

    output:
    Enter the number:5
    1 x 5 = 5
    2 x 5 = 10
    3 x 5 = 15
    4 x 5 = 20
    5 x 5 = 25
    6 x 5 = 30
    7 x 5 = 35
    8 x 5 = 40
    9 x 5 = 45
    10 x 5 = 50
    small note in (1,11,1), the first one is the starting, the 11 means upto 10 and 1 means(number of steps, i.e after 1, take 1+1=2, similar to count+=1)

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

    Thank you very much for the awesome tutorials. Easily one of the best tutorials out there! One question, where is the github project you mention in the video? I can't find it in your comments or description.

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

    number = int(input("Enter an integer: "))
    for count in range(1, 100):
    product = number + count
    print(number, "+", count, "=", product)
    Provided: 1 / it should be this one code, if I am correct. If not - please correct me. Thanks!

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

      To find Sum from 1 to 100 why you are taking number?

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

    you are such a great on python

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

    Spoiler for the task
    I did it like this
    n = 1
    w = 0
    While n

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

    2:33 It's not working.....I wrote the exactly same program in programiz python compiler and its no running but saying "invalid syntax''

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

    number = int(input("Enter any number"))
    for count in range(1,11):
    sum = number + count
    print(number,"+",count,"=",sum)

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

    limit = int(input("enter the limit"))
    current_number=0
    next_number=1
    for current_number in range (0,limit):
    sum = current_number+next_number
    current_number = sum
    next_number = sum+1
    print(sum)

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

    I have 2 string exercises which are making me hate programming with python from the heart as they are suppose to be as easy as returning 1+1.
    def pairs(txt):
    if len(txt)%2==0:
    right_indexes=list(range(1,len(txt),2))
    print(right_indexes)
    left_indexes=list(range(0, len(txt), 2))
    print(left_indexes)
    right_letters=map(list(txt).__getitem__,right_indexes)
    left_letters=map(list(txt).__getitem__,left_indexes)
    pairs=list(zip(left_letters,right_letters))
    return pairs
    I've ended up creating this list of paired tuples thinking it might help me understand better as I noticed how comparing 2 things next to each other. Because if the number of things is odd at the right side edge, it's not easy for me to know what to do.
    But it's not helping me to solve these very simple problems as I have no idea how to implement a for or while loop from pairs [(A,B),(B,C),(A,B),(C,C),(C,D)] for these 2 exercises:
    1)Make a function that removes letters that are alone. Like if you have like ABBCABCCCD it would return BBCCC
    2)Make another function which does the opposite turning like ABBCABCCC returns ACABD removing duplicates alight together (not just all).
    my brain only works to turn the whole thing into a set... ;____; When things are like this and you truly have to understand loops.... plus conversion as one is suppose to input a string and output should be a string.... I really feel like I'm the dumbest person alife
    Please help me solve these.

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

    Here it is...
    Print("result")
    For i in range(1,100):
    Print(i,end="+")
    Print(i+1)

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

    Thank you so much. This video was very helpful!

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

    your videos are always helpful heartly thanks

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

    Bro, you make things easier 🙏

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

    Thank you for explaining the concept simply. it is awesome

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

    Code to find sum upto any number
    n=int(input("Enter the number:"))
    for i in range(0, n+1, 1):
    i*=(n+1)/2
    print("The sum from 0 to", n, "is:",int( i))

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

    Hi, I used the for statement for the assignment, and this is my answer:
    count = 0
    total = 0
    for count in range(0, 100):
    total = total + count
    count = count + 1
    total1 = total + count
    print(total, "+", count, "=", total1)
    total
    thank you

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

      no the out put must be in the format of 1+2+3+4....+100
      and when you type range(0,100) the out put ends at 99 so we have to type range(0,101)

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

    Kya batoo bhut achha tutorial h bahi keep it up

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

    count=1
    number=2
    while count

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

    Your tutorials are very clear! Thanks for sharing your knowledge.
    Would there be a way to identify if the value entered is not an integer and show a message in that case, if not, do and show the sum?
    Thanks

  • @veerrr09
    @veerrr09 Год назад +2

    For anyone watching this video in 2023 (soon to be 2024):
    Here is the homework answer if you want it :> :
    number = 0
    for number in range(0,100):
    number = number+1
    print(number)
    Explanation :
    So we will always start from 0 to obtain the next number. And as explained in the video, we take the range as well. So after that since we gave our beginning value of number '0', '0' + 1 = 1. And this will continue till the range is satisfied. This is the magic of for loop!
    If somebody didnt understand, I am so sorry. Maybe I shouldnt be a teacher 😃

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

    sir mai python aapki website sai krta hoon vahan zyada syllabus hai yahan sai pr mujhe vahan literals nhi samajh aa rha aap us pr video bnaugai??

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

    sum=0
    for i in range (1,101):
    sum=sum+i
    print(sum)

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

    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

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

    well explained, keep up the good work bro.

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

    You’re brilliant - thank you :)

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

    This guy is the 🐐

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

    number = range(1,101)
    for i in range(len(number)):
    print(number[i], end='+')

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

    _*Your Programming Task:-
    number = int(input("Enter the integer"))
    for count in range(1, 101) :
    sum = number + count
    print(number, "+", count, "=", sum)

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

      this is wrong , no one have provided the correct answer in comment section

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

    Thank you so much sir👍

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

    a=sum(range(1,101))
    print(a)
    Got 5050 :3

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

    Not only python, but it is also better to make a video tutorial playlist on other programming languages like kotlin, swift, etc

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

      Well he just started making videos, he cant upload 100's videos at once

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

      @@xrhstos1330 is he the only one, then he should hire someone as interns

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

      @@sanajayakrishna if you want to see videos for a language from someone else, you could also find another yt channel.

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

    Thank you for this tutorial.

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

    Thanks for your clear enlightenment on python.
    But mine did not work has yours did. It only took the last digit of the series of number who in my case was 20.
    This is my code
    Number = int(input("Enter an integer:"))
    Product=number*count
    Print(number, "X", count, "=", product)

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

    Thank you sir 🙏 ☺

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

    result = 0
    for num in range(1, 101):
    result += num
    if num < 100:
    print(num, "+ ", end="")
    else:
    print(num, end="")
    print(" =", result)

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

    a = 0
    for b in range(0,101):
    a = a + b
    print(a)

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

      thanks

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

    number = int(input("enter a number:"))
    for count in range (1, 101):
    product = number + count
    print(number, "+", count, "=", product)

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

    infact kudos to you Punit and your team for such a great tutorial on python for beginners ! it is very clear and easy to follow

  • @grood.8925
    @grood.8925 4 года назад +1

    6:05 i am confused u have not declared the count variable and yet its showing the desired output. pls reply

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

      The count variable is declared in the first line of the loop.
      # notice count variable in for count in range(1, 10):
      for count in range(1, 10):
      print(count)

    • @grood.8925
      @grood.8925 4 года назад

      ok understood ...thank you

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

    this video was very helpful!

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

    Can you please give the answers to the task you gave us at 7:22 and the other ones you gave in other vids.

  • @durgamalleshkopanathi.1470
    @durgamalleshkopanathi.1470 Год назад

    love you bro nice class

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

    Please teach C also

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

    Great video!
    Understood everything

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

    Hi, thanks for sharing the knowledge. I have tried the counting program
    for num in range(1,11)
    sum=sum+num
    print(sum)
    when i say print, it is printing for sum value for every iteration, but if i need to print only the last sum value, can you please let me know how to do it

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

      got it, we need to place the print statement out of the loop

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

      I geess this is one month older thread though, this is how I did it. sum(list(range(101))) I am a beginner, and I feel like I am missing something.... It does its job though, right?

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

      number = int(input('Enter a number for sum'))
      count = 1
      for count in range (1,101):
      sum = number+count
      print(number, "+", count, "=" , sum)

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

    sum = 0
    for count in range(1, 101):
    sum=sum+count
    Print("sum is:", sum)

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

    my answer
    number=int(input('Enter number:'))
    for sequence in range(1,101):
    sum=number+sequence
    print(number,'+',sequence,'=',sum)

  • @MuhammadUmer-bm5ek
    @MuhammadUmer-bm5ek 3 года назад +3

    sum=0
    for count in range(1,101):
    sum=sum + count
    print("sum of 1 to 100 is=",sum)

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

    Good presentation buddy

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

    great explanation

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

    Plz solve the practice question from while loop

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

    number = 100
    product = 0
    for sum in range(1, number + 1):
    product = product + sum
    print(product)

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

    wait so is whatever you write between the for and in functions followed with a range, means nothing? No matter what I write down it will keep on going down the list of range. But I can't leave it blank either?

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

      yes, since it is like a variable, that you normally assign value to, they cannot start with number and cannot have space in between the name, and can only contain (A-z, 0-9, and _ )

  • @unnikrishnan-zi1ep
    @unnikrishnan-zi1ep 3 года назад

    Can you pls paste the link of github repository to find the programming the examples or more samples to work on

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

    this is the hardest thing ive learnt so far

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

    I want , please give a video on list, tuple, set and dictionary using for loop

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

    Thank you !

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

    you are genius

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

    For result in range(1,101):
    Sum= i + result
    Result += 1
    Print(sum)

    • @AnanthuAS-k2q
      @AnanthuAS-k2q Год назад

      Here i is not defined any where how its run

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

    Thanks to you

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

    how do we do this in a loop
    Accept names of 5 colours from the user and store it in list called ‘colours’.

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

    bro you are awesome by watching your videos i am feeling confident to give my practical

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

    love the videos bro

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

    number=0
    for number in range(0,100):
    value=number+1
    print(value,"+")

  • @shivasharma2576
    @shivasharma2576 4 года назад +13

    You making a 14 years old learn python. 🐨

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

      what do you mean bro.... not getting it?

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

      @@shankarsai2067 he is trying to say he don't know how to use A computer

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

    answer:
    **x = 0
    for i in range (1,101):
    x =+ i
    print(i)**

  • @kkminicrafts4988
    @kkminicrafts4988 7 месяцев назад

    #PROGRAM TO FIND THE SUM OF GIVEN NATURAL NUMBERS
    ans = 0
    num = int(input("ENTER THE NUMBER = "))
    print("ANSWER = ")
    for count in range(1,num+1):
    print("step",count,"=",ans,"+",count)
    ans = ans + count
    print("Total answer =",ans)