🔥 Learn Python with a more hands-on experience with Programiz PRO-interactive lessons, quizzes & challenges. Try Programiz PRO: bit.ly/right-python
@programizstudios4 жыл бұрын
Hey Guys! At 0:45, there is a minor error on our part. "Python" is a sequence of 6 characters, not 7.
@mkarazli4 жыл бұрын
No its true. PYTHO&N
@BrokeCanadian4 жыл бұрын
I count 7 characters in my sequence "Python🐍"
@raahulsingz3 жыл бұрын
@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)
@SpodermanISLoVe3 жыл бұрын
This channel is really underrated, such good content.
@otatop73594 жыл бұрын
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.
@Mugen89K3 жыл бұрын
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.
@enzy64343 жыл бұрын
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.
@sethmitchell8402 жыл бұрын
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_482 жыл бұрын
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
@sauravsingh97952 жыл бұрын
for i in range (1, 100): print(i, "+", end=" ") print(100, end=" ") print("=", sum (range(1,101)))
@SharkSnuggie Жыл бұрын
A much easier way to do it is: sum = sum(range(1, 101)) print(sum)
@chomeboy Жыл бұрын
@@SharkSnuggie sum is a built in function and you can use it as a variable?? dang.. that's crazy.
@adheeshakaumadi7 ай бұрын
@@chomeboy yes you can use it as a variable
@RishabhMall-s1z6 күн бұрын
@SharkSnuggie easier way: n=100 print(n*(n+1)/2)
@MohammedJaseemTp3 жыл бұрын
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)
@HariPrasad-mn5vu3 жыл бұрын
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
@hamburguesete4 жыл бұрын
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 !! 🇧🇷👍
@shankarsai20674 жыл бұрын
True, We need some challenging one's
@programizstudios4 жыл бұрын
Hi Raphael! Good to know that you are enjoying our videos. We will take your feedback into consideration while creating new videos. Thanks.
@VladimirTheAesthete3 жыл бұрын
Highly underrated channel, thanks a lot pal!
@irynahryma2605 Жыл бұрын
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.
@harikrishanankurup89563 жыл бұрын
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
@vedanshchn2 жыл бұрын
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)
@letstry28544 жыл бұрын
Thanks sir 👍 Keep uploading...I am regular viewer!!
@Aravindblaze954 ай бұрын
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=" ")
thaks a lot everything clearer than my professor's telling xD
@GTheo. Жыл бұрын
Man you are born to teach.. even a 5 years old can understand you..
@multitaskprueba14 жыл бұрын
You are a genius and a great professor! Thanks a lot!
@125-ronaka73 жыл бұрын
loved the way of teaching , as well as the content
@torpedoe19363 жыл бұрын
So simply explained. Unbelievable. Thanx boss!
@shadanakhtar50953 жыл бұрын
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
@before2am3 жыл бұрын
def numsum(): sum=0 for current_number in range(0,101): sum = current_number + sum print(sum)
@ashmitakaran67552 жыл бұрын
2:33 It's not working.....I wrote the exactly same program in programiz python compiler and its no running but saying "invalid syntax''
@brandonlittlejohn80552 жыл бұрын
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
@topan3689 Жыл бұрын
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 Жыл бұрын
To find Sum from 1 to 100 why you are taking number?
@AnsonCheung10492 жыл бұрын
for loop in range (1,100000): if loop == 1: num2=0 num1=num2 num2=loop+num1 if loop ==100: print(num2)
@kirisutokyoto35053 жыл бұрын
number = range(1,101) For a in number: print (a,"+",end="")
@ajithkumar-mg2lx2 жыл бұрын
Nice Bro
@স্টোরিলিন2 жыл бұрын
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)
@rock89383 жыл бұрын
sum=0 for count in range(1,101): sum=sum+count print(sum)
@gamingtech22113 жыл бұрын
_*Your Programming Task:- number = int(input("Enter the integer")) for count in range(1, 101) : sum = number + count print(number, "+", count, "=", sum)
@kusumguragain4756 Жыл бұрын
this is wrong , no one have provided the correct answer in comment section
@gabrielladangler17224 жыл бұрын
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! :)
@programizstudios4 жыл бұрын
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.
@gabrielladangler17224 жыл бұрын
@@programizstudios Thank you for the clarification! :)
@grood.89254 жыл бұрын
6:05 i am confused u have not declared the count variable and yet its showing the desired output. pls reply
@programizstudios4 жыл бұрын
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.89254 жыл бұрын
ok understood ...thank you
@Mugen89K3 жыл бұрын
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.
@siderealvictor98134 жыл бұрын
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??
@majidalich29472 жыл бұрын
sum_num = 0 for i in range(1, 101): sum_num = sum_num + i print(sum_num)
@Priyanshukumar_482 жыл бұрын
Here it is... Print("result") For i in range(1,100): Print(i,end="+") Print(i+1)
@surya6912 жыл бұрын
Awesome lecturing brother 👍👍
@meghanajana62111 ай бұрын
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
@DigitalAcademyOnline3 жыл бұрын
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
@avantika607711 ай бұрын
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)
@saharshprathibh63363 жыл бұрын
number = int(input("Enter any number")) for count in range(1,11): sum = number + count print(number,"+",count,"=",sum)
@kusumguragain4756 Жыл бұрын
this is not a correct answer for the above question
@ugabuga44564 жыл бұрын
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.
@mycreativecorner88312 жыл бұрын
Great video👍, the way of your explanation is very good👌, all concepts are clear.
@avantika607711 ай бұрын
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))
@Penguindude_3 жыл бұрын
Spoiler for the task I did it like this n = 1 w = 0 While n
@mohammadkazifaruk209710 ай бұрын
you are such a great on python
@MohammedJaseemTp3 жыл бұрын
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)
@স্টোরিলিন2 жыл бұрын
not working properly, :-(
@ArunKumar-zz4tg Жыл бұрын
Awesome Explanation Brother
@Titina71832 жыл бұрын
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
@jasontuladhar12223 жыл бұрын
Can you please give the answers to the task you gave us at 7:22 and the other ones you gave in other vids.
@RjAhtesham3 жыл бұрын
your videos are always helpful heartly thanks
@panagiotisbotonakis23494 жыл бұрын
Thank you so much. This video was very helpful!
@girishgh9793 Жыл бұрын
count=1 number=2 while count
@liw49723 жыл бұрын
Thank you for explaining the concept simply. it is awesome
@jubayethossain81323 жыл бұрын
sum=0 for i in range (1,101): sum=sum+i print(sum)
@asadzamir92493 жыл бұрын
But this not work bro
@brahimayoada26572 жыл бұрын
This guy is the 🐐
@amarnathm3143 жыл бұрын
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
@amarnathm3143 жыл бұрын
got it, we need to place the print statement out of the loop
@vincentkim61273 жыл бұрын
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?
@cristianacrestani59413 жыл бұрын
number = int(input('Enter a number for sum')) count = 1 for count in range (1,101): sum = number+count print(number, "+", count, "=" , sum)
@Abdulbasittia2 жыл бұрын
Bro, you make things easier 🙏
@hannahgilbert3467 Жыл бұрын
You’re brilliant - thank you :)
@raviteja_sannala3 жыл бұрын
number = range(1,101) for i in range(len(number)): print(number[i], end='+')
@ahmadullahlutfi69463 жыл бұрын
well explained, keep up the good work bro.
@kanika12 жыл бұрын
number = int(input("enter a number:")) for count in range (1, 101): product = number + count print(number, "+", count, "=", product)
@naga_nihal_playz57773 жыл бұрын
Great video! Understood everything
@IamKudos2 жыл бұрын
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?
@khalilmahmood2 жыл бұрын
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 _ )
@shivasharma25764 жыл бұрын
You making a 14 years old learn python. 🐨
@shankarsai20674 жыл бұрын
what do you mean bro.... not getting it?
@karthik93544 жыл бұрын
@@shankarsai2067 he is trying to say he don't know how to use A computer
@efeucar60322 жыл бұрын
this video was very helpful!
@banana_assasin39072 жыл бұрын
this is the hardest thing ive learnt so far
@shahporanhimel92073 жыл бұрын
a=sum(range(1,101)) print(a) Got 5050 :3
@godwinakoto45784 жыл бұрын
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
@mekkakelvin80572 жыл бұрын
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)
@veerrr09 Жыл бұрын
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 😃
@MProtik2 жыл бұрын
wait..!! How did he used # in every line by one click 4:50
@gauravfromuttaranchal59213 жыл бұрын
Kya batoo bhut achha tutorial h bahi keep it up
@unnikrishnan-zi1ep3 жыл бұрын
Can you pls paste the link of github repository to find the programming the examples or more samples to work on
@DREYM36010 ай бұрын
result = 0 for num in range(1, 101): result += num if num < 100: print(num, "+ ", end="") else: print(num, end="") print(" =", result)
@cactusdg4 жыл бұрын
a = 0 for b in range(0,101): a = a + b print(a)
@SHPUDY4 жыл бұрын
thanks
@joyceadhiambo99772 жыл бұрын
my answer number=int(input('Enter number:')) for sequence in range(1,101): sum=number+sequence print(number,'+',sequence,'=',sum)
@ibekwevictor11582 жыл бұрын
Thank you for this tutorial.
@sarbjitchoong45782 жыл бұрын
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
@mynameisv6302 жыл бұрын
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)
@sanajayakrishna4 жыл бұрын
Not only python, but it is also better to make a video tutorial playlist on other programming languages like kotlin, swift, etc
@xrhstos13304 жыл бұрын
Well he just started making videos, he cant upload 100's videos at once
@sanajayakrishna4 жыл бұрын
@@xrhstos1330 is he the only one, then he should hire someone as interns
@xrhstos13304 жыл бұрын
@@sanajayakrishna if you want to see videos for a language from someone else, you could also find another yt channel.
@DanyloNihmatulin Жыл бұрын
number = 100 product = 0 for sum in range(1, number + 1): product = product + sum print(product)
@saravanapothi5744 жыл бұрын
sum = 0 for count in range(1, 101): sum=sum+count Print("sum is:", sum)
@kkminicrafts49886 ай бұрын
#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)
@zoeyyuen4204 Жыл бұрын
For result in range(1,101): Sum= i + result Result += 1 Print(sum)
@AnanthuAS-k2q Жыл бұрын
Here i is not defined any where how its run
@brotherhood20013 жыл бұрын
I want , please give a video on list, tuple, set and dictionary using for loop
@slimerelaxation53982 жыл бұрын
how do we do this in a loop Accept names of 5 colours from the user and store it in list called ‘colours’.
@saumyatripathi22123 жыл бұрын
Plz solve the practice question from while loop
@okbruh16174 жыл бұрын
Good presentation buddy
@pachakutiq2664 жыл бұрын
we can use the following code to obtain the result : sum(range(1,101)) Please feel free to correct me if am wrong but the answer is 5050 so i guess we can do it that way.
@abdulraheemabioye42464 жыл бұрын
I ran this code... didn't work
@pachakutiq2664 жыл бұрын
@@abdulraheemabioye4246 I guess , I did it with a variable , sorry for the vague answer 😅 Code : x = sum(range(1,101)) print(x) That should work! I used it in another way last time , I don't remember exactly will let u know when I do
@Mathu2006 Жыл бұрын
number=0 for number in range(0,100): value=number+1 print(value,"+")
@dannydj29084 жыл бұрын
product = 0 for count in range(0,101): product = product + count print(product)
@programizstudios4 жыл бұрын
It's correct but you are printing the result in each iteration of the loop. Instead, just print the result once after the loop ends. Also, you can give a better variable name like total instead of product.
@madhumahendran60772 жыл бұрын
Could anyone clarify me how the result of the sum of 1 to 100 is not executed in the rows but as sum of all? i believed the for loop will provide result in rows, like 1+1 =2 2+1=3 etc
@magiiicuno3981 Жыл бұрын
total_sum = 0 for i in range(1,101): total_sum += 1 print(total_sum , "+", end=" " )
@GaurieVerma3 жыл бұрын
I checked out the answer for the task on github and the output is supposed to only be 5050, but when i write the same code in python i get a whole lot of numbers and the last number is 5050. am i doing something wrong or is it supposed to be like that?
@konstantinskoblik66402 жыл бұрын
Perhaps the indentation level of print(total) is similar to "total = total + number". So print(total) is the part of body "for". If print(total) has the same indentation level as "total=0", it'll work out. You'll get 5050 without unnecessary numbers such as 4950, 4851, etc.
@Kartv3li3 жыл бұрын
answer: **x = 0 for i in range (1,101): x =+ i print(i)**
@DoubleTroubleSigma4 жыл бұрын
Please teach C also
@MuhammadUmer-bm5ek3 жыл бұрын
sum=0 for count in range(1,101): sum=sum + count print("sum of 1 to 100 is=",sum)
@bhaktibhosale34273 жыл бұрын
Thank you so much sir👍
@abdulraheemabioye42464 жыл бұрын
Hello, i ran the code as written in github and the output listed the all the sum iterations (i.e 1,3,6,10... 5050) instead of just the output (5050). Kindly assist. Thanks
@swagger1982 Жыл бұрын
To print the result it must be outside the for loop To get outside the for loop remove all space before the print(result)
@sandipansarkar92114 жыл бұрын
great explanation
@ramakrishnadevireddy23954 жыл бұрын
for a in range(101): print('+',a, end=' ')
@karthikkiran3384 жыл бұрын
where's other part of the code? end is not defined