No video

Python Program to Check Prime Number - Complete Guide | Python Tutorial

  Рет қаралды 90,031

WsCube Tech

WsCube Tech

Күн бұрын

In this video, learn Python Program to Check Prime Number - Complete Guide | Python Tutorial. Find all the videos of the 100+ Python Programs Course in this playlist: • Python Program to Add ...
💎 Get Access to Premium Videos and Live Streams: / @wscubetech
WsCube Tech is a leading Web, Mobile App & Digital Marketing company, and institute in India.
We help businesses of all sizes to build their online presence, grow their business, and reach new heights.
👉For Digital Marketing services (Brand Building, SEO, SMO, PPC, SEM, Content Writing), Web Development and App Development solutions, visit our website: www.wscubetech...
👉Want to learn new skills and improve existing ones with in-depth and practical sessions? Enroll in our advanced online courses now and make yourself job-ready: courses.wscube...
All the courses are job-oriented, up-to-date with the latest algorithms and modules, fully practical, and provide you hands-on projects.
👉 Want to learn and acquire skills in English? Visit WsCube Tech English channel: bit.ly/2M3oYOs
📞 For more info about the courses, call us: +91-7878985501, +91-9269698122
✅ CONNECT WITH THE FOUNDER (Mr. Kushagra Bhatia) -
👉 Instagram - / kushagrabhatiaofficial
👉 LinkedIn - / kushagra-bhatia
Connect with WsCube Tech on social media for the latest offers, promos, job vacancies, and much more:
► Subscribe: bit.ly/wscubech...
► Facebook: / wscubetech.india
► Twitter: / wscubetechindia
► Instagram: / wscubetechindia
► LinkedIn : / wscubetechindia
► KZbin: / wscubetechjodhpur
► Website: wscubetech.com
-------------------------------------| Thanks |--------------------------
#pythontutorials #python #pythonprogramming

Пікірлер: 85
@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
@ihaveitinme638
@ihaveitinme638 8 ай бұрын
def prime_number(n): if n==1: b=print(n,":not prime") return b if n>1: for i in range(2,n): if n%i==0: c=print(n,":not prime") return c break else: print(n,":prime number") n=int(input("enter number:")) prime_number(n)
@BMWCLASSICS_
@BMWCLASSICS_ Ай бұрын
bro i think in last we also have to put break when i run it on my pc it shows 2 output
@swamantakmajumder4876
@swamantakmajumder4876 3 ай бұрын
a=int(input()) c=0 for i in range(1,a+1): if a%i==0: c=c+1 if(c==2): print("Prime number") else: print("Not prime")
@Lotus_TheGirly
@Lotus_TheGirly 2 ай бұрын
I did this...but this is nt working 😭annnnnn
@sumaiya_730
@sumaiya_730 7 күн бұрын
@@Lotus_TheGirly it is working bro lol
@hrishabhbramhe1697
@hrishabhbramhe1697 2 ай бұрын
x = 4 if x ==1: print('not a prime') elif x ==2: print('prime') elif x>2: for i in range(2,x): if x%i == 0: print('not prime') break else: print('prime') break
@user-eq9zj8tl3g
@user-eq9zj8tl3g Жыл бұрын
Thanks mam. Even telusko hadnt explained this topic this superb. It helped me who is from no CS background.
@sakshimourya5418
@sakshimourya5418 Жыл бұрын
you deserve more likes, cleared my concept completely.
@GoGetSP
@GoGetSP 14 күн бұрын
num=int(input("Enter a num to check whether prime or not:")) if num == 1: print(num,"is not a prime number.") elif num == 2: print(num,"is the smallest prime number.") else: for i in range(2,num): if num % i ==0: print(num," is not a prime number.") else: print(num,"is a prime number.") break
@itsonlytech8251
@itsonlytech8251 2 жыл бұрын
Nice Information
@sushantchougale6818
@sushantchougale6818 2 жыл бұрын
Thank you very much 😊 ☺️
@khushiv2003
@khushiv2003 Жыл бұрын
n=int(input()) if n==1: print('n is not prime') elif n==2: print('n is prime') else: for i in range(2,n): if n%i==0: print('n is not prime') break else: print('n is prime')
@rushijadhav6903
@rushijadhav6903 2 ай бұрын
What about 99,15,21,25 they are not prime number
@nirajgamingbr
@nirajgamingbr 2 жыл бұрын
Nice video
@naresh9675
@naresh9675 2 жыл бұрын
Grateful
@00__mdasif
@00__mdasif 2 жыл бұрын
We wanna deep sir python videos please upload plz....
@Anubhav_Sh_
@Anubhav_Sh_ 6 ай бұрын
very helpful playlist.
@gauravpandey9739
@gauravpandey9739 5 ай бұрын
You are amazing mam❤
@VARADHARLIKAR-ul1oc
@VARADHARLIKAR-ul1oc Ай бұрын
def prime_number(n): if n==1: b=print(n,"is not an prime number") return b if n>1: for i in range(2,n): if n%i==0: c=print(n,"is not an prime number") return c break else: print(n,"is prime number") n=int(input("enter the number to check :")) prime_number(n)
@kabeersharma6403
@kabeersharma6403 Жыл бұрын
Thanku Thanku Thanku Thanku
@impavel323
@impavel323 26 күн бұрын
a= ("Thank You Mam") Print(a)
@ronak-myself
@ronak-myself Жыл бұрын
Sb samajh agya
@bgmiviralshort
@bgmiviralshort 2 жыл бұрын
Good
@tabariqawabullah0626
@tabariqawabullah0626 Жыл бұрын
Great video. But This code is saying 9,15,21... are prime numbers but they are not. Any idea why?
@madiripadma3877
@madiripadma3877 Жыл бұрын
Prime number means the number divisible by 1 and itself.for eg : 5 5 is divisible by 1 and 5 only so it is prime number.
@AdityaThakur-cq1ov
@AdityaThakur-cq1ov Жыл бұрын
I think something wrong with this code.... it's say 49 is prime .....kese......
@karthikchinna3621
@karthikchinna3621 9 ай бұрын
You need to add break statment
@comingsoon..4258
@comingsoon..4258 5 ай бұрын
computer science students attendance here
@Bunty759
@Bunty759 2 ай бұрын
Present sir
@oxivrushab2573
@oxivrushab2573 11 ай бұрын
num=float(input(" enter the number ")) if(num%2==0)or(num%3==0)or(num%4==0)or(num%5==0)or(num%6==0)or(num%7==0)or(num%8==0)or(num%9==0)or(num%11==0): print( " number is not prime") else: print(" the numver is prime")
@Mr.Regaltos
@Mr.Regaltos 9 ай бұрын
it will say 13 is not prime wrong
@asishkumarpatro5903
@asishkumarpatro5903 5 ай бұрын
Bhai infinite prime h tu aise nahi kar sakta
@manjari400
@manjari400 Жыл бұрын
This code is not working appropriately for 2 and the odd numbers that are non prime number like 15,21,9 etc.
@AshishVerma13yq
@AshishVerma13yq 7 ай бұрын
Same doubt
@Staredits006
@Staredits006 5 ай бұрын
Same
@badalmishra7395
@badalmishra7395 5 ай бұрын
It is working fine. I think the problem you got is with "else" . You need to shift it as she said backwards
@asishkumarpatro5903
@asishkumarpatro5903 5 ай бұрын
​@@badalmishra7395but shouldn't if and else statements be in the same indentation?
@badalmishra7395
@badalmishra7395 4 ай бұрын
@@asishkumarpatro5903 yes correct. But in this case if you use the same indentation as "if" in the for loop, it will throw "it is a prime number " multiple time , to break that loop for the output printed once, we need to get that else out of that for loop indentation or use the same indentation used for "for loop" statement. Secondly else should be the same indentation as "if" -True , but , here we have 3 ifs', and the code determines what should be the indentation of else. That's how loop function works
@abhijeetsinghyadav8988
@abhijeetsinghyadav8988 4 ай бұрын
n= int(input("Enter any number: ")) if (n%n==0) and (n%2!=0) and (n>1): print("Given number is a prime ") else: print("No is not a prime ")
@akashrai5253
@akashrai5253 3 ай бұрын
This same condition is apply to many numbers like 15 when it is divided by 2 it will not return 0 but it is not a prime number, so this condition will not work even mam's condition is also not working.
@oxivrushab2573
@oxivrushab2573 11 ай бұрын
Can we use only in if condition using or like number which divides by 2,3,4,5,7,6,8,9,11 are not prime else are prime my work effectively
@itzmasum1079
@itzmasum1079 Жыл бұрын
With this code please try input "2"
@Aditya_Deshmukh
@Aditya_Deshmukh Жыл бұрын
x =int(input("Enter Your Number Please: ")) if x == 2: print("A Prime Number.") else: for i in range(2,x): if x % i == 0: print("Not a Prime Number.") break else: print("A Prime Number.")
@gtdforum
@gtdforum Жыл бұрын
Is there a need for a for loop in this example
@anud1917
@anud1917 Жыл бұрын
# 11:program to check if any given number is a prime number. num = int(input("enter the number")) if num
@sapisgreat
@sapisgreat 7 ай бұрын
doesnt work with 0
@asishkumarpatro5903
@asishkumarpatro5903 5 ай бұрын
​@@sapisgreatwill work bhai
@sapisgreat
@sapisgreat 4 ай бұрын
@@asishkumarpatro5903 didnt for me
@wannabe_gamer1230
@wannabe_gamer1230 2 ай бұрын
How about 2?
@raosajid6578
@raosajid6578 Жыл бұрын
9 is does not satisfy your code if user enter 9 then it will give us it is prime but it is not
@rohitraj7914
@rohitraj7914 9 ай бұрын
9 jb enter krenge to num=9 ho jayega to loop 2-8 tk hi chlega. So condition is satisfying for 9 also.
@asishkumarpatro5903
@asishkumarpatro5903 5 ай бұрын
​@@rohitraj7914no brother 9 divisible by 3 so it doesn't work
@cnadegameplay8031
@cnadegameplay8031 2 ай бұрын
hey, check 43 as input.
@sohebsk2196
@sohebsk2196 Жыл бұрын
this code does not hold for some numbers,,,here isthe correct version: n=int(input("ENTER A NUMBER=")) if n
@asishkumarpatro5903
@asishkumarpatro5903 5 ай бұрын
2 is prime brother
@statusvideo2701
@statusvideo2701 Жыл бұрын
Which platform(application) maam is using to run python code ... Please someone reply...
@shubham_gaming-i2v
@shubham_gaming-i2v Жыл бұрын
pi charm
@shubham_gaming-i2v
@shubham_gaming-i2v Жыл бұрын
num=int (input("enter the number")) if num==1: print("not prime") for a in range(2,num): if num%a==0: print("it not a prime number") break else: print("prime number")
@user-rz4tc5rp1v
@user-rz4tc5rp1v 7 ай бұрын
here you miss another if condition
@prittamsingh4453
@prittamsingh4453 Жыл бұрын
mam which software you are using
@prinjaymandani7419
@prinjaymandani7419 Жыл бұрын
pycharm
@Abhinavmittal00
@Abhinavmittal00 3 ай бұрын
667 is not a prime no. and not divisible by any no. from 2to 10
@sahildash7222
@sahildash7222 11 ай бұрын
num=13 fcount=0 for f in range(1,num+1): if(num%f==0): fcount=fcount=1 if(fcount==0): print('It is a prime number') else: print('not a prime number')
@Aditya_Deshmukh
@Aditya_Deshmukh Жыл бұрын
x =int(input("Enter Your Number Please: ")) if x == 2: print("A Prime Number.") else: for i in range(2,x): if x % i == 0: print("Not a Prime Number.") break else: print("A Prime Number.")
@bobbyrajgorai695
@bobbyrajgorai695 11 ай бұрын
we can use this also; x=float(input('enter the year')) if (x+1)/2%2==0 : print ( ' the no. is prime') else: print (' the no. is not prime')
@oxivrushab2573
@oxivrushab2573 11 ай бұрын
Not effective bro👍🏻
@oxivrushab2573
@oxivrushab2573 11 ай бұрын
For 27
@rameezraja2489
@rameezraja2489 9 ай бұрын
Simple program ko itna complex kyu bana Diya aapne ek hi condition lagega if num%==0 then print non prime number then else num%==1 then print....... whatever you want to print
@turyachaitanya
@turyachaitanya Жыл бұрын
Another metho num = int(input("Enter a number ")) count = 0 if num>1: for i in range(1,num+1): if (num%i) == 0: count =count+1 if count == 2: print(num,"is a prime number") else: print(num,"is not a prime number")
@asishkumarpatro5903
@asishkumarpatro5903 5 ай бұрын
Won't work 1 se sabka remainder 0 aayega
@sunnyyadav1298
@sunnyyadav1298 6 күн бұрын
Didi nhi ho paya tumse rehne do
@dhaHu
@dhaHu 9 ай бұрын
People starting in English and later changing their language 🙂but y
@gamingstudyff9525
@gamingstudyff9525 2 жыл бұрын
Hello sir I am a school student . Sir mai athichal hacking sikhna chahta hu plz mere ko batai ki Whete to star
@AdityaThakur-cq1ov
@AdityaThakur-cq1ov Жыл бұрын
Abhi se phle where ki spelling thik kro fir agge dekhte h
@premgautam4957
@premgautam4957 2 жыл бұрын
Please help me sir
@rishiraj2548
@rishiraj2548 Жыл бұрын
print("Prime Number Check") num = int(input("Enter a number to check: ")) status = "prime" if num
@turyachaitanya
@turyachaitanya Жыл бұрын
num = int(input("Enter a number ")) if num < 2: print("Enter a number") elif num == 2: print(" 2 is a prime number") else: for i in range(2,num): if num%i ==0: print(num,"is not a prime number") break else: print(num,"is a prime number")
@shubham_gaming-i2v
@shubham_gaming-i2v Жыл бұрын
@turyachaitanya if num < 2: print("Enter a number") elif num == 2: print(" 2 is a prime number") ye vala part ka use kya tha jab 2 se num tak spicify kar rahe hai tu
@turyachaitanya
@turyachaitanya Жыл бұрын
@@shubham_gaming-i2v 2%2 is 0, it will say not prime, but 2 is prime. So a line is written for 2.
@DataEngineer586
@DataEngineer586 11 ай бұрын
n= int(input("Enter any number: ")) if (n%n==0 and n%2!=0 and n>1): print("Given number is a prime ") else: print("No is not a prime ") # please let me know if this method is wrong of writing code
@ManishKumar-rd2iy
@ManishKumar-rd2iy 10 ай бұрын
Your code is wrong bro
@saritashukla123
@saritashukla123 4 ай бұрын
This code is not right.
@VineelDikkala
@VineelDikkala 2 ай бұрын
Why bro??
@someshbiswas119
@someshbiswas119 Ай бұрын
@@VineelDikkala because 93 is not a prime number but this code shows it is a prime number
Python Program to Generate a Random Number (Hindi)
4:30
WsCube Tech
Рет қаралды 39 М.
PRIME NUMBER PROGRAM IN PYTHON PROGRAMMING || PYTHON PROGRAMMING
7:45
Sundeep Saradhi Kanthety
Рет қаралды 79 М.
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 8 МЛН
Magic? 😨
00:14
Andrey Grechka
Рет қаралды 18 МЛН
拉了好大一坨#斗罗大陆#唐三小舞#小丑
00:11
超凡蜘蛛
Рет қаралды 5 МЛН
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 926 М.
Python Program to Check Leap Year (Hindi) | Python Tutorial
8:51
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 438 М.
Learn NUMPY in 5 minutes - BEST Python Library!
13:38
Python Programmer
Рет қаралды 843 М.
👩‍💻 Python for Beginners Tutorial
1:03:21
Kevin Stratvert
Рет қаралды 3,2 МЛН
Find the Factorial of a Number - Python Program Tutorial🔥
14:58
Python for Beginners - Learn Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 18 МЛН
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 261 М.
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 8 МЛН