No video

Python Program to Print all Prime Numbers in an Interval - Complete Tutorial

  Рет қаралды 61,545

WsCube Tech

WsCube Tech

Күн бұрын

Пікірлер: 45
@wscubetech
@wscubetech 2 жыл бұрын
😎Hey, thanks for watching! We’d love to know your thoughts/doubts here in the comments. 👉For professional self-paced certification courses (pre-recorded), visit: bit.ly/Pre-Recorded-Course 👉Don’t forget to SUBSCRIBE to our channel for more such videos & valuable content: bit.ly/KZbin-WsCubeTech
@vaibhavv475
@vaibhavv475 10 ай бұрын
More explanation is needed as to how the value continues to be printed......
@shaikhkashif9973
@shaikhkashif9973 6 ай бұрын
Thanks
@durgaprasadbandari968
@durgaprasadbandari968 25 күн бұрын
great explanation
@PythonProjectSolver
@PythonProjectSolver 7 ай бұрын
why 2 is consider as a prime number? because when 2 going to second for loop it is range of (2,2) than it check 2%2 that is equal to 0 than that is not a prime number. the solution is : find_p = range(1, 101) for p in find_p: if p > 1: for x in range(2, int(p**0.5) + 1): if p % x == 0: break else: print(p)
@venkatagovindpiradi1397
@venkatagovindpiradi1397 Ай бұрын
I'm also thinking the same😢
@sushantchougale6818
@sushantchougale6818 2 жыл бұрын
Thank you very much Madam 😊
@velocxty2477
@velocxty2477 Жыл бұрын
Great explanation ma’am!⚡️
@Picture_of_truth
@Picture_of_truth 2 ай бұрын
start=int(input("enter starting no:")) end=int(input("enter ending no:")) num=0 for num in range(2,end): for i in range(2,num): if num%i==0: break; else: print(num)
@__ayu
@__ayu Жыл бұрын
THANK YOU...
@Abdul-tu6mq
@Abdul-tu6mq 4 ай бұрын
Sprrrrrrrrr maam
@Neerajahir02.ahir.
@Neerajahir02.ahir. 2 жыл бұрын
Nice
@agrimgupta0805
@agrimgupta0805 3 ай бұрын
we can make it more optimized?
@ArtiKumari-rb6lj
@ArtiKumari-rb6lj 10 ай бұрын
Ma'am prime number repeated in output.
@Harshdhillon
@Harshdhillon 9 ай бұрын
Don’t print them in for loop break out from it
@KritarthShuklaA
@KritarthShuklaA 8 ай бұрын
Apna indentation check kro
@user-uk8yd4xj4i
@user-uk8yd4xj4i 5 ай бұрын
Same problem
@a.dashish2844
@a.dashish2844 2 ай бұрын
Your second If and else statment must in the block first range function
@a.dashish2844
@a.dashish2844 2 ай бұрын
x = int(input(" x: ")) y = int(input(" y: ")) for i in range(x, y+1): if i > 1: # Ensuring we only consider numbers greater than 1 for m in range(2, i): if i % m == 0: break else: print(i) # Only prints if no divisor was found
@dawood3578
@dawood3578 2 ай бұрын
mam I have a question. If I try to print else: statement with a tab space, right under second if, it prints the prime number more times than one. But when I write it like you have, behind the if: statement, it prints correctly. Isn't it necessary to use else: directly under if: statement. Please let me know. Thanks!
@ROHITH_PRO_51
@ROHITH_PRO_51 8 күн бұрын
Same doubt bro
@swastikpanda5670
@swastikpanda5670 20 күн бұрын
this is my code yet i am not getting the correct output: a=int(input("a: ")) # b=int(input("b: ")) # num=0 # for num in range (a,b+1): # if num>1: # for i in range(2,num): # if num%i==0: # break # else: # print(num)
@ammarahmad7036
@ammarahmad7036 2 жыл бұрын
It's true
@mohammadajharuddeen8933
@mohammadajharuddeen8933 2 жыл бұрын
Reach native ka full course upload kro please
@ashsaha5750
@ashsaha5750 10 ай бұрын
Code is not working... Expexted indented block saying... irritating
@MuhammadAwais-yt6je
@MuhammadAwais-yt6je 2 жыл бұрын
Unreal engine 5 ka b cours layaa
@AmaanKhan-cb4rn
@AmaanKhan-cb4rn 11 ай бұрын
❤❤❤
@ZenBeats01
@ZenBeats01 2 жыл бұрын
❤️❤️
@mekalachinnikrishna8372
@mekalachinnikrishna8372 9 ай бұрын
Mam we are using num here but we are not defined num then how your output will come
@user-ic3xc1hu3v
@user-ic3xc1hu3v 9 ай бұрын
Cz num koi variable ni h jisme values store krvai ho , simply "i" ko replace Kia h "num" se ,which means items in that range of numbers
@ichchakushwaha3209
@ichchakushwaha3209 Жыл бұрын
hey i printed "num+1 " at the place of "num", and not getting the "2" in output as a prime number l=int(input("lower limit: ")) u=int(input("upperr limit: ")) for num in range(l,u+1): if num>1: for i in range(2,num+1): if num%i==0: break else: print(num) break this is my code
@GamingGalaxyFF
@GamingGalaxyFF 11 ай бұрын
remove the last break command then it will work😊
@AryanHuria
@AryanHuria 9 ай бұрын
Hey you are doing in second loop num+1 , then it's wrong suppose from the first loop you took 99 , and the second loop gets divided by 99 , if you will write num+1 , it will get divided by 99 too and therefore program won't return a single prime number.
@shashankpandey5187
@shashankpandey5187 6 ай бұрын
check indentation once(your else statement)
@thangutabbycat
@thangutabbycat 10 ай бұрын
i%j==0. Ie... 2%2==0.... thats right? Then how 2 printed in prime
@kishorem5461
@kishorem5461 8 ай бұрын
Same doubt
@zulfiquarshaikh3461
@zulfiquarshaikh3461 7 ай бұрын
@wscubetech pls explain if 2%2 ==0 , then how 2 is getting printed in output
@PythonProjectSolver
@PythonProjectSolver 7 ай бұрын
this is correct code : find_p = range(0, 100) for p in find_p: if p > 1: for x in range(2, int(p**0.5) + 1): if p % x == 0: break else: print(p)
@PythonProjectSolver
@PythonProjectSolver 7 ай бұрын
this is correct code : find_p = range(0, 100) for p in find_p: if p > 1: for x in range(2, int(p**0.5) + 1): if p % x == 0: break else: print(p)@@kishorem5461
@PythonProjectSolver
@PythonProjectSolver 7 ай бұрын
@@zulfiquarshaikh3461 this is correct code : find_p = range(0, 100) for p in find_p: if p > 1: for x in range(2, int(p**0.5) + 1): if p % x == 0: break else: print(p)
@muzamilrana8854
@muzamilrana8854 2 жыл бұрын
1st comment😍
@sakshikadu7722
@sakshikadu7722 10 ай бұрын
i kya h
@user-ic3xc1hu3v
@user-ic3xc1hu3v 9 ай бұрын
Items in range(0, upto to given num)
@skcreates343
@skcreates343 2 жыл бұрын
Mai es video par pahli baar aaya hu or Python learn karna chahta hu. Kya hum Python me koi app devlop kar sakte hai ? Kya hum Python se online tool bana sakte hai ? Can you guide me god bless you 🙏🙏🙏🌸🌸
@TilakRaj-qo6ic
@TilakRaj-qo6ic Жыл бұрын
Python is becoming a general purpose language slowly so you can do anything you want
Underwater Challenge 😱
00:37
Topper Guild
Рет қаралды 20 МЛН
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 36 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 21 МЛН
Underwater Challenge 😱
00:37
Topper Guild
Рет қаралды 20 МЛН