For Loops in Python | Python Tutorial - Day #17

  Рет қаралды 753,094

CodeWithHarry

CodeWithHarry

Күн бұрын

Python is one of the most demanded programming languages in the job market. Surprisingly, it is equally easy to learn and master Python. This python tutorial for absolute beginners in Hindi series will focus on teaching you python concepts from the ground up.
Access the Playlist: • Python for Beginners (...
Link to the Repl: replit.com/@co...
Join Replit the browser-based IDE used in this course - join.replit.co...
►Checkout my English channel here: / @programmingwithharry
►Instagram: codewithharry
python, C, C++, Java, JavaScript and Other Cheetsheets [++]:
Playlist: • Coding CheatSheets 🧾 b...
►Learn in One Video[++]:
Python[15 Hr]: • Python Tutorial For Be...
Python Advance[3.5 Hr]: • Python Programming Cou...
Python[1 Hr]: • Learn Python In Hindi ...
Python[2 Hr]: • Python Tutorial In Hin...
Python[15 Min]: • 15 Minute Python Tutor...
JavaScript[1 Hr]: • JavaScript Tutorial
C[1.3 Hr]- • C Programming Tutorial...
php[1 Hr]: • Learn Php In One Video...
php[2.3 Hr]: • Php Tutorial for Begin...
php[Project]- • Login And Registration...
HTML[30 Min]: • HTML 5 Tutorial For Be...
CSS[8.5 Hr]: • CSS Tutorial In Hindi ...
CSS[1.4 Hr]: • CSS 3 Tutorial For Beg...
Wordpress[3.2 Hr]: • How To Make a WordPres...
Angular[2 Hr]: • Angular Tutorial in Hindi
Java[2.3 Hr]: • Java tutorial in hindi 🔥
Web Scraping[1 Hr]: • Web Scraping Tutorial ...
MongoDB[2 Hr]: • MongoDb Tutorial For B...
Numpy[1 Hr]: • Numpy Tutorial in Hindi
Android Dev[12 Hr]- • Android Development Tu...
Linux[1 Hr]: • Linux Tutorial For Beg...
JQuery[1.1 Hr]: • jQuery Tutorial For Be...
Git and GitHub[1.1 Hr]: • Git & GitHub Tutorial ...
►Complete course [playlist]:
React: • React Js Tutorials in ...
Python- • Python Tutorials For A...
OOP Python- • Object Oriented Progra...
Java: • Java Tutorials For Beg...
JavaScript- • JavaScript Tutorials I...
PHP- • PHP Tutorials in Hindi
C- • C Language Tutorials I...
C++- • C++ Tutorials In Hindi
Git & GitHub- • Git and GitHub Tutoria...
Android Dev- • Android Development Tu...
Python GUI- • Python GUI: Tkinter Tu...
Web Development- • Web Development Tutori...
Python Django: • Python Django Tutorial...
Projects Using HTML, CSS & Javascript- • Projects Using HTML, C...
Data Structure and Algo: • Data Structures and Al...
Follow Me On Social Media
►Website (created using Django Rest & Angular): www.codewithha...
►Facebook: / codewithharry
►Instagram: / codewithharry
Twitter: / codewithharry
Comment "#HarryBhai" if you read this 😉😉

Пікірлер: 1 000
@syedaaiman6989
@syedaaiman6989 Жыл бұрын
The loop starts at 1 and increments by 3 in each iteration until it reaches a value that is less than 12. The values printed are 1, 4, 7, and 10.
@secular786
@secular786 10 ай бұрын
3-3 ke gap me print krega values ko 1-12 Tak
@GlitchyGlobe
@GlitchyGlobe 10 ай бұрын
This is the best explaination, I couldnt find words to express. Thankyou
@Anubis_playzz
@Anubis_playzz 10 ай бұрын
Best explanation in simple words .
@zq.nain.
@zq.nain. 8 ай бұрын
thank you
@ananyasomabajpai358
@ananyasomabajpai358 6 ай бұрын
Thanku bro
@pulkitpareek
@pulkitpareek Жыл бұрын
Step is used for increment or decrement in loops. For ex. for k in range(1,12,3): print(k) It increases the value by three as 1,4,7,10
@TECHWIZARD137
@TECHWIZARD137 Жыл бұрын
Yup, As in C/C++
@arpankarmakar16
@arpankarmakar16 Жыл бұрын
Similar concept to string formatting step size argument.
@pubgmaster5827
@pubgmaster5827 Жыл бұрын
Bro but 10 tk hi isme 3 add hua h esa kyu
@pulkitpareek
@pulkitpareek Жыл бұрын
@@pubgmaster5827 uske baad 13 print hona tha lekin 13 tak range nhi hai, isliye 10 par stop ho gya
@arpankarmakar16
@arpankarmakar16 Жыл бұрын
@@pubgmaster5827 Aise samjho step or stride (step ko hi stride bolte hain). stride = 3 yani ki har 3ri number ko print karo. I think aise sochna makes it easier and their's also nothing wrong
@junaid19929
@junaid19929 Жыл бұрын
11:44 Range have 3 parameters (Strat , stop , step) Step is basically an difference between the first number and last number it may be varied as per the user .
@rusty-coder
@rusty-coder Жыл бұрын
Updation function
@gnomeunknown4717
@gnomeunknown4717 Жыл бұрын
So basically an Arithmetic Progression with range(first term, sort of last term, common difference) ?
@cricketmode230
@cricketmode230 Жыл бұрын
That its call as jump ..
@BhooveshVyas
@BhooveshVyas Жыл бұрын
​@@gnomeunknown4717yesss
@nagwag123
@nagwag123 Жыл бұрын
hey this course by harry is enough for python?
@vertechua
@vertechua Жыл бұрын
The third argument in the range() function specifies the number of skips the for loop has to encounter whilst its process. Like if the range(1, 10, 3) is run, the output will be all the number starting from 1, and with a skip of 3, i.e 1, 1+3, 1+3+3 etc.
@shubhooogaming6234
@shubhooogaming6234 Жыл бұрын
yes
@RohitPaikrao
@RohitPaikrao Жыл бұрын
thanks i
@stauncharmy8605
@stauncharmy8605 4 ай бұрын
Thank u ❤
@adnanbayadwala8670
@adnanbayadwala8670 Жыл бұрын
Hey harry! I am truly grateful for your efforts! I will surely try to contribute to your work in someway! I regularly watch your python and javascript videos, i am being taught by you and i enjoy watching your videos. Thanks you sir!
@mujtabahussin6369
@mujtabahussin6369 Жыл бұрын
tablenum = int(input("which table you want?: ")) table1 = int(input("x * y = x: type your y: ")) print(" ") for table1 in range(table1 + 1): print(f"{tablenum} * {table1} = ", table1 * tablenum)
@user-px9gn7ry7x
@user-px9gn7ry7x Жыл бұрын
In Python, the range() function is commonly used in for loops to generate a sequence of numbers that are then iterated over. The range() function can take up to three arguments: start, stop, and step. The step argument determines the difference between consecutive numbers in the generated sequence. # start :stop:step for i in range (5,100,5): print(i,end = " ")
@sharma..8905
@sharma..8905 3 ай бұрын
copied answer
@_sam_2004._
@_sam_2004._ Ай бұрын
What is the use of this end?
@debasishbesra2901
@debasishbesra2901 Жыл бұрын
Day 4 of #100DaysOfCode. Today in this video 17, I learned about loops in Python, specifically for loops, which can iterate over iterable objects like strings, lists, tuples, sets, and dictionaries. I also learned about the range() function for controlling loop iteration based on a specific range of numbers, including how to define start, end, and step values. Thank You Harry Bhaiya.
@prabhkiratsingh4a917
@prabhkiratsingh4a917 Жыл бұрын
yes bro!!!
@Aditya-jo1of
@Aditya-jo1of Жыл бұрын
@@prabhkiratsingh4a917 bhai mai class 4 mai hu
@sureshyadav9317
@sureshyadav9317 Жыл бұрын
@@Aditya-jo1of to?
@Aditya-jo1of
@Aditya-jo1of Жыл бұрын
@@sureshyadav9317 mai bta rha hu mai class 4 mai hu
@sureshyadav9317
@sureshyadav9317 Жыл бұрын
@@Aditya-jo1of are bhai bhut seekh liya hoga per jbtk tumhari job lgegi tb tk coding will be of ai
@rohitmaurya6897
@rohitmaurya6897 Жыл бұрын
for i in range (1,20,3) # Here 1 is starting number of for loop and 20 is last number and 3 is used for jumping/gapping number between range.
@venturousgamer5879
@venturousgamer5879 Жыл бұрын
thanks bro
@neelukumari5859
@neelukumari5859 Ай бұрын
Output is 1 4 7 10 13 16 19
@hetalchaudhary2881
@hetalchaudhary2881 2 ай бұрын
1 start, 12 end, 3 step 1 1+3 = 4 4+3 = 7 7+3 = 10 or fir 3 plus hota hai to 13 ho jata hai lekin range me 11 tak hi print hoga isliye 10 tak hi aayega.
@MAFIAFFxx
@MAFIAFFxx 2 ай бұрын
who is inn 2024 ??
@Harsh-zr2eo
@Harsh-zr2eo 2 ай бұрын
Me
@sharminakon9348
@sharminakon9348 2 ай бұрын
Me
@not_Progameryt
@not_Progameryt 2 ай бұрын
Me
@shivvay3765
@shivvay3765 Ай бұрын
Me
@manugaming0409
@manugaming0409 Ай бұрын
Bhai sare hi h
@unolive8026
@unolive8026 Жыл бұрын
Not first ,but I am regular watched your video
@ABsingh.143
@ABsingh.143 Жыл бұрын
Naam kya hai, aap ka..
@KoushikDas2005
@KoushikDas2005 Жыл бұрын
I have regularly watched*
@Tanishq_Chaurasia
@Tanishq_Chaurasia Жыл бұрын
Haa ye krlo pehle
@nawalkishor1914
@nawalkishor1914 Жыл бұрын
@@KoushikDas2005 i am regularly watching **
@KoushikDas2005
@KoushikDas2005 Жыл бұрын
@@nawalkishor1914 that's true in present continuous I said in present perfect Haha :)💀
@oo-tes6642
@oo-tes6642 Жыл бұрын
Day 17 consistency ✌️ Btw : c/c++/java se Anne walo logo k liye (easy Language) thodi mushkil hai 😂 q ki hume curly braces aur parentheses aur variable type explicitly declare karne ki addat hai 😂😂
@amanKumar-sn1te
@amanKumar-sn1te Жыл бұрын
You are right bro 👍👍👍
@Umer_Ayyan
@Umer_Ayyan Жыл бұрын
Same bhai
@sandeepshorton
@sandeepshorton Жыл бұрын
😂
@sonumehta8515
@sonumehta8515 Жыл бұрын
us bhai😂😂
@mujtabahussin6369
@mujtabahussin6369 Жыл бұрын
tablenum = int(input("which table you want?: ")) table1 = int(input("x * y = x: type your y: ")) print(" ") for table1 in range(table1 + 1): print(f"{tablenum} * {table1} = ", table1 * tablenum) #can you for table of millions * millions
@CodingWithJas
@CodingWithJas Жыл бұрын
In every video of This course has learned me at least one new thing about python !!! Thanks ❤️ Harry bhai
@yatinshekhar787
@yatinshekhar787 7 ай бұрын
Was confused about how to use for loop , but now got some clarity. Thanks
@zenayush1
@zenayush1 Жыл бұрын
in for loop increment by default is 1. but if u want to overwrite that so you have to use step parameter for that. for k in range(1,12,3) in this example 1 is start point 12 is till u want to go and 3 is steps which is u overwrited. output: 1 4 7 10 mean with 1 now incrementing 3.
@Kyobi_AMV
@Kyobi_AMV Жыл бұрын
Thanks
@rahulsaha7539
@rahulsaha7539 Жыл бұрын
Hi Harry! I follow your channel and really like your content. I wonder if you could make a separate video on Excel automation through Python. As I work in the financial industry such a course would be really helpful. Some of the organizations are still using the age-old VBA to automate excel file. However, if we start using python, it will really make our job a lot easier. Thanks in advance.
@sandipsaha2005
@sandipsaha2005 Жыл бұрын
yes..
@kaifansari1327
@kaifansari1327 Жыл бұрын
I want this python automation with excel
@curlde5277
@curlde5277 4 ай бұрын
range(x,y,z)=x= start,y=limit,z=number can miss during print(z-1).
@arnavtumbde6249
@arnavtumbde6249 Жыл бұрын
In the last part of the video, amongst the three numbers, the last number got added to the first number and gave the output. The middle number represented the upper limit till which the output would be calculated. If the addition exceeds the middle number, the program terminates.
@provokeman-bc3uq
@provokeman-bc3uq Жыл бұрын
for k in range(1,30,3): print(k+2) if we are print like this so we are get esily table of three and if we can print like this for k in range(1,20,2): print(k+1) so we can print table 2
@jaideepawari7523
@jaideepawari7523 Жыл бұрын
A very helpful course Harry Bhai! Can't thank you enough
@clashingtv2527
@clashingtv2527 Жыл бұрын
Bhi Harry bhi ka 8 hr wala karlo 3 din me khatam ho jayga and fir aoo Fir jaldi samj ayga 😍
@mujtabahussin6369
@mujtabahussin6369 Жыл бұрын
tablenum = int(input("which table you want?: ")) table1 = int(input("x * y = x: type your y: ")) print(" ") for table1 in range(table1 + 1): print(f"{tablenum} * {table1} = ", table1 * tablenum)
@focusonyourtarget528
@focusonyourtarget528 Жыл бұрын
Actually if we compare this for loop with Java for loop it's basically for(i = 1; i
@aryyann05
@aryyann05 Жыл бұрын
yes kind of but the second argument is not a condition, more like the ending point
@yudhi1980
@yudhi1980 Жыл бұрын
Dear Harry, why did you stop Machine Learning series. Please continue. It was very useful.
@iamparikshitsingh
@iamparikshitsingh Жыл бұрын
if we are ranging something in x,y,z then, x,y are ranges from where it going to start and where it going to end and z is for stepping the range, if we are not using the stepping then the list will run as follows, i.e. (1,6) 1,2,3,4,5,........ and if we use stepping ( 1,6,2) then it will count 1 then skip 2 digits then show 4 etc. so the list is like ( 1,4.....)
@krankumarsharma2895
@krankumarsharma2895 Жыл бұрын
Bhaiya vscode ka maza replit me nhi aa rha hai
@cacklesgaming7627
@cacklesgaming7627 4 ай бұрын
To bhai tum vs code use karlo
@ShivaAchary-q7g
@ShivaAchary-q7g 3 күн бұрын
​@@cacklesgaming7627bade ache advices dete ho hacker lagte ho 🌚
@idkjustok6629
@idkjustok6629 3 ай бұрын
For k in range( start, stop, step) The loop starts k from "start" and increments by "step" till the time value of k < "stop"
@KoushikDas2005
@KoushikDas2005 Жыл бұрын
11:48 it's the step value. Used for incrementing and decrementing the values as per requirement. It can go forward as well as backward as per the step value given.
@unolive8026
@unolive8026 Жыл бұрын
Regular watched* , Don't Span
@KoushikDas2005
@KoushikDas2005 Жыл бұрын
@@unolive8026 tu rhne de 🙏
@unolive8026
@unolive8026 Жыл бұрын
@@KoushikDas2005 tuhhhh. Toh gaya beta
@PROGRAMMER_CODER
@PROGRAMMER_CODER Жыл бұрын
#Decrement in for loop for l in range(20,15,-1): print(l)
@mr.electron5295
@mr.electron5295 Жыл бұрын
Haryy bhi step is use to skip a value from given range for eg : for i in range( 1, 20 ,10) : print(i) will print : 1, 11 as output it will jupm 10 steps form the first value
@minetech9972
@minetech9972 10 ай бұрын
00:00 Introduction to Loops 01:31 Loops in programming 03:07 Python has iterable objects that can be looped over using for loops 04:33 Learn to iterate through strings and lists in Python 06:07 Learn about indentation, iterating lists, and using the for loop 07:38 Print numbers between two given values using range() function 09:24 Understanding the range function in Python 10:56 Explore the third parameter of range Crafted by Merlin AI.
@praveendeshaveni6408
@praveendeshaveni6408 9 ай бұрын
Bro are you completed this course how many days you have taken to complete
@santhk1437
@santhk1437 9 күн бұрын
for x in range ( a, n , d ) print(x) a = first term n = last-1 term d = common difference
@worldupdate122
@worldupdate122 Жыл бұрын
Big fan harry sir I have learnt whole basic python 12 hour video But I have not laptop May thats why I can't able to Make or use ' sample.txt file' or open sample.txt in pydroid3 Except this I have learnt all things Please make a proper video on topic " open or write any .txt without opening " On pydroid 3 Thanks a lot
@anantkumar007
@anantkumar007 Жыл бұрын
Why dont you use replit Its available for android
@worldupdate122
@worldupdate122 Жыл бұрын
@@anantkumar007 Bro it takes time to run the code as well as could not do if full screen in my device For to use my keyboard perfectly 😏😏😏😏😏😏
@deepikaop4545
@deepikaop4545 Жыл бұрын
# for loop in string name = 'Vannie' for i in name: print(i,end=' ') print("Thanks for using it ") # for loop in List List01 = ['Vannie','Princess'] for names in List01: print(names) # Range function # if you have seen Avengers Endgame You will get it for i in range(1,3001): print('Love You ',i) # Step argument in range for i in range(2,22,2): print(i)
@navinthenoob2227
@navinthenoob2227 Жыл бұрын
I made this program using loop for 1st TIME: print("This is Number Printer!") print("Print no. from 0 to 5000") print("") a=int(input("Enter first: ")) b=int(input("Enter second: ")) if a and b > 5000: print("Numbers Can Only be from 0 to 5000") else: if b
@souvikroy3584
@souvikroy3584 2 ай бұрын
@CodeWithHarry the loop start from 1 to and 12 and the numbers are increment in each step at 3 until it reaches a value which is less than 12. the values are 1,4,7,10.
@vedprakashjaiswal25
@vedprakashjaiswal25 Жыл бұрын
Third parameter will increment the loop according to its vale(value passed in third parameter)
@rajkamalkumar7022
@rajkamalkumar7022 Жыл бұрын
the third parameter is increment the value of range ex of for k in range( 1,200,4) this expression is starting in 1 and ending in i-1 and increment the value of 4 per iteration
@muhammadumairali4220
@muhammadumairali4220 Жыл бұрын
quick quiz :- third parameter is evaluated after each iteration in for loop
@saqlain_ch
@saqlain_ch Жыл бұрын
It prints the first value, and then keeps doing increments without printing any value until it reaches the nth value, where n is the step argument. For example we use 3 as 3rd argument and range 1-10, It will print 1st value which is 1 and then print every next 3rd value 1, 4(1+3), 7(4+3) , 10(7+3)
@Kuch_Bhi-lets_explore_it
@Kuch_Bhi-lets_explore_it Жыл бұрын
Day - 17 Present Sir Python 🔥🔥 Sir please make a video on GSOC ( google summer of code , how we can participate and win the certification of GSOC and 1500$ Stipend from google , pls make a video on this from scratch , So we can participate in GSOC 2023 , Thank you so much harry bhai ❤❤
@RudrakshGirdhar-gb9zu
@RudrakshGirdhar-gb9zu Жыл бұрын
Is this course includes DSA???
@suvrajitpanda3797
@suvrajitpanda3797 Жыл бұрын
@@RudrakshGirdhar-gb9zu allready DSA playlist available in this channel you can chk
@Kuch_Bhi-lets_explore_it
@Kuch_Bhi-lets_explore_it Жыл бұрын
@@RudrakshGirdhar-gb9zu I don't know about It , Only Harry Bhai Can answer this , In my opinion Might be it include some DSA because it is for 100 days ....
@RudrakshGirdhar-gb9zu
@RudrakshGirdhar-gb9zu Жыл бұрын
@@suvrajitpanda3797 okay but I was asking can I rely on this for DSA?
@suvrajitpanda3797
@suvrajitpanda3797 Жыл бұрын
@@RudrakshGirdhar-gb9zu u can also use C program and Java for DSA
@aizazahmedkhan
@aizazahmedkhan 3 ай бұрын
In this scenario , the for loop in this range starts from 1 , increments1 with 3, increments 4 with 4, and at the end increments 7 with the value of 3 making it 10. 1 4(1+3) 7(4+3) 10(7+3)
@anantkumar007
@anantkumar007 Жыл бұрын
Sorry Harry Bhai, I will not be able to follow this course My 10th pre-boards have started and boards pressure 😔😔😔😞😞😞😞 But after the boards I will definitely complete this course. Love you brother You got me into coding You are the best ❤❤❤
@shreeshmainde768
@shreeshmainde768 Жыл бұрын
bro I am in 10th too my prelims are gnna start from 8th jan but I have decided to give at least half an hour of my day to learn python programming like common we can dedicate at least 30 mins to programming
@deepikaop4545
@deepikaop4545 Жыл бұрын
bro ye sab bahana hai coding sachme sikhni hai to daily time fix krlo for bs utna time bhi doge to ho jayega samjhe
@mariamhasan3733
@mariamhasan3733 Жыл бұрын
Dude, I'm also going to give my 12th pre-board exam next time. You won't ever learn it if you keep leaving it for later. Better give at least 20 minutes to coding. This will help you to leave the monotonous of studying
@arpankarmakar16
@arpankarmakar16 Жыл бұрын
@@deepikaop4545 Boards jyada important hain bhai..
@akshadjogi2555
@akshadjogi2555 Жыл бұрын
@@arpankarmakar16 skills > degree
@brandonnoronha5535
@brandonnoronha5535 3 ай бұрын
Step is the argument in the range function in for loop which basically is a value which adds to the i variable. For example, if i=0 and step=2 then the output will be like print(i+step) which is equal to i=i+step i.e., 0+2=2
@md.abdullahalmamun960
@md.abdullahalmamun960 Жыл бұрын
The step function is used as increment and decrement value for the range values which is added by python before printing the next element. The first element will printed as it is which is the starting,int,float and any element.
@ulpnationll2953
@ulpnationll2953 Жыл бұрын
Basically step func. terminates or skip the no.s in between in loops. Just like in the above case where the code was: for i in range(1,12,3): print(i) The output is 1,4,7,10 . SO IT BASICALLLY SKIPS EVER TWO LETTERS IN BETWEEN THE NO.S OF IN SIMPLE WORDS IT ADDS 3
@IAMSHARMA1108
@IAMSHARMA1108 Жыл бұрын
Range parameters are (start, Stop, Step). So, loop starts with 1 and every iterations it Stops on 3rd parameter means (1,2,3) and then again starts from 4 and stop on another 3rd parameter i.e. 7 and it will go until it reach a value less than 12. Happy Learning !!!! 😁
@priyangsagar3140
@priyangsagar3140 6 ай бұрын
step is used for intervals between values of sequence. eg:- for i in range(0,1001,100): print(i) output will be:- 0 100 200 300 400 500 600 700 800 900 1000 >
@adityagoswami8144
@adityagoswami8144 Жыл бұрын
Explanation of quick quiz : The third argument in range is used for determining the difference between two consecutive numbers: like shown at 10:58 in video the program print the numbers with a difference of 2 (3-1=2) and similarly at 11:17 the program print the numbers with difference of 3 (4-1=3)
@abhay_69420
@abhay_69420 Жыл бұрын
Thanks bro
@sudhansubalasahoo
@sudhansubalasahoo Жыл бұрын
Present Sir Well well well i don't have instagram sir so i post the explanation here range(start, stop, step) iterates like for(i=start, i < stop, i += step), so it add the number in step upto stop hope this is understandable for people not knowing java or c++
@shaon1412
@shaon1412 Жыл бұрын
Day 6 of asking to make a discord server
@NiraShinde-se2ir
@NiraShinde-se2ir 4 ай бұрын
Day 1 of telling wait for next year 😂
@vineetkharkwal
@vineetkharkwal Жыл бұрын
thank you bhaiya mene aapki 129 videos wali python playlist dekhi n really usse mujhe bhut help mili n thank you for all your efforts.. thank you big bro..🙏
@aamirzaheeransari
@aamirzaheeransari Жыл бұрын
I am present 🎁🎉
@vmin_love_9
@vmin_love_9 Жыл бұрын
it is the property of range(). In for k in range(1,12,3) print(k) 1 is the value from where loop starts, 12 is the value where loop stops, and 3 is the difference between the values.
@rudrakshtripathi4592
@rudrakshtripathi4592 Жыл бұрын
Code :- for k in range(1,12,3): print(k) Explanation :- this basically means the 1 will be printed and after that 2 numbers will be skipped(2 and 3) and then 4 will be printed , this is happening because the third parameter given in the range function is called the step parameter, if the value of the step parameter is given as 4, then 3 values will be skipped and the 4th value will be printed.
@kakashi3886
@kakashi3886 2 ай бұрын
The loop starts with 1 and it adds value to it by 3 until the final output reaches up to a number that is less than 12. Example 1+3= 4, 4+3=7 , 7+3= 10 , it will not add 3 now as the value will be 13.
@abhishekbapat315
@abhishekbapat315 Жыл бұрын
Fibonacci series can also be developed using the last example of range function with 3 parameters
@nitinrathour415
@nitinrathour415 7 ай бұрын
third argument in range() is a step-up value that will increase start value by given step-up value ex: for i in range (1, 10, 2): # starting from 1, ends at 10-1, and 2 is step-up_value print(i) output: 1 # start from 1 3 # now 1+2= 3 5 # 3+2 = 5 7 # 5+2 = 7 9 # 7+2 = 9 # and because now 9+2 = 11, It will stop at 9
@nigamGvlog
@nigamGvlog Жыл бұрын
attendance here
@tiddu1566
@tiddu1566 22 күн бұрын
The third parameter ;step is the interval between each number in the sequence and it is the ratio by which each number is printed after an increment which is the third parameter: step
@CodeWithHarry
@CodeWithHarry Жыл бұрын
Code Backup Repository: github.com/CodeWithHarry/100-days-of-code-youtube
@user-tl7qv6td1l
@user-tl7qv6td1l 6 ай бұрын
Day 17
@CAREDITZ-o4o
@CAREDITZ-o4o 22 күн бұрын
oho
@Codehatch344
@Codehatch344 Жыл бұрын
range(1,100,2) here 2 is a step value now step value is basically refers as the difference value between the two values e.g 1 and 3 so basically it is a common difference for an AP created by range function.
@saurabhsinha3359
@saurabhsinha3359 Жыл бұрын
(start, stop , step) first to hmare "start" point ko print krega fir next me jo bhi value aayega use hmare "step" se devide krega agr hmara remainder 1 aayega to us value ko print krega nhi to dusre value ke liye cheak krega aur hmare "stop" point tk cheak krta jayega for n in range(1, 15, 3): print(n) Output:- 1 4 7 10 13 (1) Firstly we will print starting point = 1 then cheak condition (2) 2%3=0 remainder is 0. we will not print 2 (3) 3%3=0 remainder is 0. we will not print 3 (4) 4%3=1 remainder is 1 . we will print 4 (5) 5%3=2 remainder is 2. we will not print 5 (6) 6%3=0 remainder is 0. we will not print 6 (7) 7%3=1 remainder is 1. we will print 7 (8) 8%3=2 remainder is 2. we will not print 8 (9) 9%3=0 remainder is 0. we will not print 9 (10) 10%3=1 remainder is 1. we will print 10 (11) 11%3=2 remainder is 2. we will not print 11 (12) 12%3=0 remainder is 0. we will not print 12 (13) 13%3=1 remainder is 1. we will print 13 (14) 14%3=2 remainder is 2. we will not print 14 (15) 15%3=0 remainder is 0. we will not print 15
@nileshtayade3546
@nileshtayade3546 Жыл бұрын
for k in range(1,12,3) It just increments the value of k by 3 for each iteration. And by default the step is 1.
@NavneetSingh-io4jh
@NavneetSingh-io4jh Жыл бұрын
And what about the value 0?? He hasn't mentioned k + 1 🤔🤔
@nileshtayade3546
@nileshtayade3546 Жыл бұрын
@@NavneetSingh-io4jh if you want to print from 0 you just have to change first argument of range like range(0,3)
@FXJAAT
@FXJAAT Ай бұрын
for h in range(2,10,2): print(h) output: 2,4,6,8 the first number for start and 2nd for the end last for the incress in number after 1st to last
@shaikmehboob0303
@shaikmehboob0303 4 ай бұрын
It is very easy when ever we are giving range 1,12 it is python thinks to print number 1,2,3 like as upto 11 when ever we are giving range( 0,12,2) it is initially print 1 first after it will be add to (1+3=4) (4+3=7) (7+3=10) the last condition is false(10+3=13) so the range is. 1,4,7,10
@__Atif_7190
@__Atif_7190 Жыл бұрын
@codewithharry sir let (a, b, c) if we run this code then it's result is (a+c) but c must be less the b. And code also gives the value less then b For example range (1,5,2) After print that is 1 1+2=3 2+2=4 But not gives 4+2=6 Because 6 is greater then 5
@horiyakhan4156
@horiyakhan4156 6 ай бұрын
There are 3 range functions start, stop and step, general syntax of range: range( start, stop, step) step is used to increment between start and stop e.g , range in i ( 10, 1, 2) output is 1, 3, 5, 7,9 The start is 1, the stop is 10 (exclusive), and the step is 2. It generates a sequence of numbers starting from 1, incrementing by 2, and stopping before reaching 10.
@13naaz
@13naaz Жыл бұрын
jaise ke string slicing me tha.. (start:,stop:,step:) or (begin:,end:,step:) step jo hai agar 2 denge it will skip 2 nos,, ex:range(1,10,2).... 1,3,5,7,9 will be the o/p
@ukgamer_0788
@ukgamer_0788 4 ай бұрын
Range me (1, 12, 3) is ka output 1,4,7,10 ye isliye aaya kyuki step value index me add hoti hai or fir bech ke index chodke value ATI hai ex= start value 1 to print hogi hi uske bd. 1 ka index 0 tha is 0index me 3 step value add Hui or ans 4 aaya kyuki 0+3=3 or 3 index pr 4 tha isliye or har bar updated index me 3 step value add hogi or ans milega
@sk-ph3io
@sk-ph3io 4 ай бұрын
ap hin kehden hen😏
@mohdsuhail4938
@mohdsuhail4938 Жыл бұрын
in third argument it prints a sequence of numbers like Arithmetic Progression(AP)..1, 4,7,10, and it prints this till 12 comes it does't print 10 + 3= 13 because its greater than 12
@TheTop10PremiumList
@TheTop10PremiumList 2 ай бұрын
Hi, 1,12 mean 1 up to 11 number Like This: 1 2 3 4 5 6 7 8 9 10 11 and the 3 mean 1 number after 3 numbers not execute! so easy 😊😊
@shazidulhaquesimanta4584
@shazidulhaquesimanta4584 Жыл бұрын
In python range( start,stop,step) is a function : where, start states-> From where to start ;Default is 0. stop states->Where to stop;Given value step states-> The incrementation part of the output... @Bangladesh
@howtovideos978
@howtovideos978 6 ай бұрын
As a C++ student it was little confusing. But you explained it very well. Thanks:)
@musicprofile6376
@musicprofile6376 Жыл бұрын
for k in range (1,2,3) print 1 but if its not sorted ex for k i range(9,4,3) prints nothings !! but for harry bhaiya code it gives different in range when you pass three parmeters : range(start , stop,step) output = start , start+step , start +step and stops before the stop condtion
@aminaikram6114
@aminaikram6114 Жыл бұрын
for k in range(1,12,3) here 1 is the starting value, 12 is the ending value(n-1) and 3 is step ( i.e 3 steps to increase) 1+3=4 ,4+3=7, 7+3=10.
@lizakhan8684
@lizakhan8684 Жыл бұрын
For i in range(1, 100001): Print("thankyou so much ❤️, you're the best")
@IGIMF
@IGIMF Жыл бұрын
Hello bro if you are free then please help me. If you can give your Instagram I'd then it would be a great pleasure for me.
@muhammadqaim3303
@muhammadqaim3303 10 күн бұрын
3rd parameter is also used for decrement simply write range(12,1,-1) to decrement one number....
@orbex9365
@orbex9365 Жыл бұрын
if I print this- for k in range(1,14, 3): print(k+1) It will print from 1 to 13 and maintain the gap of 3 digits like the output would be 2 6 10 14 ab khush :) harry bhai?
@riteshsrivastava2030
@riteshsrivastava2030 Жыл бұрын
I hav a doubt plz solve Ques.- Write a program to display all the integers from 1 up to and including some integer entered by the user followed by a list of each number's prime factors. Number greater than 1 that only have a single factor will be marked as prime. For example, if the user enter 10 then the output of the program should be : Enter the maximum value to display : 10 1=1 2=2 (prime) 3=3(prime) 4=2*2 5=5(prime) 6=2*3 7=7(prime) 8=2*2*2 9=3*3 10=2*5
@IGIMF
@IGIMF Жыл бұрын
Hello bro if you are free then please help me. If you can give your Instagram I'd then it would be a great pleasure for me.
@riteshsrivastava2030
@riteshsrivastava2030 Жыл бұрын
@@IGIMF pardon me bro i am a school boy and i do not use insta
@IGIMF
@IGIMF Жыл бұрын
@@riteshsrivastava2030 ok, can you please explain me about for lop, please
@riteshsrivastava2030
@riteshsrivastava2030 Жыл бұрын
@@IGIMF which point u r unable to understand
@IGIMF
@IGIMF Жыл бұрын
@@riteshsrivastava2030 var = 'harry' For i in harry: Print(i) Here what is 'i', how did this i came, what is it means and how every charcter in the string came in new line
@OneUploads
@OneUploads Жыл бұрын
The quiz is simple python is just jumping to next n number on the third argument means if n is 3 then the answer will be 1,4,7,10
@muhammadmudassir2210
@muhammadmudassir2210 Жыл бұрын
for example for i in range(1,67,2) print(i) 1 say start ho ga or 2 ka difference ho ga 67 tk print karay ga output(1,3,5,7,9,11....)
@user-tb7qo9ts8y
@user-tb7qo9ts8y Ай бұрын
Bhaiya i chose cs in class 11th and 12th with science stream and they only taught python in 11th and a bit SQL in 12th but python still covered mostly syllabus...believe me when i say i never understood a thing and even got bad grades in cs...Now I passed out and will start my 1st semester(btech with cs core) soon and I literally thank god that I found your channel ...Thank you so much
@rizwan9493
@rizwan9493 Жыл бұрын
for k in range (1,12,3) printts the following 1 4 7 10 it leave gap for 3 number
@sunilverma1975
@sunilverma1975 Жыл бұрын
It is stepping in( int) function Start inclusive :integer upto (exclusive):character to be skipped For example For l in Range (1, 13,1) Print(l) = 1,2,,3.......
@mantra2965
@mantra2965 Жыл бұрын
The step function helps us to skip the digit entered.... For example if we enter 2 in skip..... We will be able to see 1-3-5-7....etc .....basically it skips that particular digit and gives you the output
@ridabaig7071
@ridabaig7071 11 ай бұрын
Range(2, 21, 2) The first number depicts the starting point of a range and the second number shows the limit of the range. The third number shows for how many times a number from the range will be skipped. range(2, 21, 2) hence will print table of 2 till 20
@mr__x__gaming__3892
@mr__x__gaming__3892 Жыл бұрын
range(1 , 12 , 3) is simply using step , step like it will start from 1 then skip the three steps [1+3] and go on untill his he reach "y" second value....12...
@joesnotebook3524
@joesnotebook3524 Жыл бұрын
Step function helps to arrange number in sequence , for example , if you want to print numbers of 2 till ten , you can write like this: for i in range (2,11,2): print(i)
@aakashSharma-is9bk
@aakashSharma-is9bk 9 ай бұрын
the output will be 2,4,6,8 right ?
@joesnotebook3524
@joesnotebook3524 9 ай бұрын
2,4,6,8,10 also will be there
@MohiniGiri704
@MohiniGiri704 Жыл бұрын
Harry Bhai, it's your new python course for beginners so, I think that those who are beginners they should do more practice in python for mastering it...for that if u add some easy to hard level exercises like in your Desi style about each topic which u teach us ....if possible then Plzz could you implement on it...hope.....thx for teaching us in Desi way👍
@flakky1262
@flakky1262 Жыл бұрын
ahhhh same mai bhi yehi kah rha tha and your comment was posted 2 months ago matalab lectures jab ongoing the harry sir didnt even baited eye aghhhhh
@arslanahmed6996
@arslanahmed6996 3 ай бұрын
The range function in Python comes with 3 arguments: start, stop, and step. range(start, stop, step) e.g. for i in range(1, 10, 2): print(i) Here, 1-->starting point, 10--> Stopping point 1-->step size, difference between each point. Extras: *As a default zero is the starting point if the starting point is not defined *the range function in Python not to include the stop value follows a common pattern in computer science known as half-open intervals. In a half-open interval, the starting point is inclusive, but the ending point is exclusive.
@goldentalks1991
@goldentalks1991 Жыл бұрын
# when we pass three arguments in range its mean range(start , stop , step) from where we want to start as we wish and step will increment every time which we want to do increment and stop where we want to stop.
@DyNaMiC_GG
@DyNaMiC_GG Ай бұрын
step is in short an AP where first term is given , common difference is given and the number up to which it can go is given(maximum value/range)
@famousfiltermachineries
@famousfiltermachineries 3 ай бұрын
it start with range() 1st number [which is 1 in example] then + plus with the 3rd number[ which is 3 in Ex_] until it is
@ujjwalkumaragrahari4285
@ujjwalkumaragrahari4285 Жыл бұрын
For i in range(1, 12, 3): Print(i) Output - 1,4,7,10 In range the first argument is starting no. Of loop, second is ending of loop and third is skip or increase no. Of loop
@MuhammadAbubakar-ev5jz
@MuhammadAbubakar-ev5jz Жыл бұрын
The step is that part of the for loop construction that tells how much to increase or decrease the value of its leading variable. sir basically ye increment and decrement use kar raha hai
@cyborgs2102
@cyborgs2102 Жыл бұрын
x= "raghav rana" for i in x: print(i) b = {"yellow ","green ","black "} # why output vary when we use space "yellow _" or "yellow" for c in b: print(c) for z in c: print(z)
@MaxGaming-ip4tc
@MaxGaming-ip4tc Жыл бұрын
That is incrementation (or decrementation) parameter that prints the value, number of values specified after the previous number
@devtomar8472
@devtomar8472 9 ай бұрын
The range () function in python works by taking 3 inputs as parameters which are start_value, stop_value and step_value. The range() function returns an immutable sequence of numbers starting from the start_value, and increments the value by the value given in the step_value, and stops at the stop_value. Ex. for seq in range(1, 20, 5): print(seq) Output: 1 6 11 16
@AshmitaJ-e6h
@AshmitaJ-e6h 6 ай бұрын
Present sir ji, Thanks for all your effort and make us learn everyday a new thing. bohot bohot dhanyawad apka. you deserve more than 100M subscriber you will reach soon sirji. best teacher we are watching.
@galactusff6315
@galactusff6315 2 ай бұрын
3rd parameter or step indicates the common difference of the A.P
@revolution_bop777
@revolution_bop777 Ай бұрын
♦️♦️I have a doubt... In that color's program, pehle print(color) Diya or phir print (i) Diya. Toh pehle sare colours print hoke phir spellings print hone chahiye na???
@YashMalhotra13
@YashMalhotra13 Жыл бұрын
#In for loop range function of python is: for i in range(10,110,10): print(i) #Here first argument is the starting point from where your loop begins, #Second argument is the ending point of for loop that at what point your loop stops(it generally execute till n-1) #and the third argument tell about the step size of loop #In this case loop start from 10 and give step of 10 numbers and print till (stop-step) which is (110-10)
While Loops in Python | Python Tutorial - Day #18
14:10
CodeWithHarry
Рет қаралды 611 М.
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 949 М.
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 15 МЛН
Brawl Stars Edit😈📕
00:15
Kan Andrey
Рет қаралды 43 МЛН
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
The CUTEST flower girl on YouTube (2019-2024)
00:10
Hungry FAM
Рет қаралды 48 МЛН
#20 Python Tutorial for Beginners | While Loop in Python
12:43
Telusko
Рет қаралды 1,6 МЛН
Nested loops in Python are easy ➿
5:35
Bro Code
Рет қаралды 295 М.
Functions in Python | Python Tutorial - Day #20
16:18
CodeWithHarry
Рет қаралды 704 М.
For Loop in Python | Python Tutorials for Beginners #lec42
19:42
Jenny's Lectures CS IT
Рет қаралды 157 М.
Which Operating System I use and Why 💻
14:57
CodeWithHarry
Рет қаралды 137 М.
Python vs JavaScript | What to Choose? | ft. Toolify.ai
9:23
CodeWithHarry
Рет қаралды 177 М.
Python For Loops - Python Tutorial for Absolute Beginners
14:42
Programming with Mosh
Рет қаралды 587 М.
How much HTML, CSS and JavaScript is Enough to get a Job 🔥
14:32
CodeWithHarry
Рет қаралды 266 М.
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 15 МЛН