Simple and good .need more videos on the programs which are general in interviews
@AmulsAcademy6 жыл бұрын
Sure:) Thank you:)
@SriOonchamaratuKaruppanar014 ай бұрын
Yeah, yeah ,yeah😂😂😂
@priyankavaidya1104 жыл бұрын
Thank you so much for explaining with example. I was confused with for loop. Now ,it is completely clear to me ....how it works.
@AmulsAcademy4 жыл бұрын
Glad it was helpful! :)
@abhishekpani67353 жыл бұрын
Thanku so much .. it really helped me...❤️
@AmulsAcademy3 жыл бұрын
Glad to hear that :)
@Joshi_Vibes4 жыл бұрын
after watching so mny videos i understood from yours ty:-):-)
@AmulsAcademy4 жыл бұрын
Glad to hear that :)
@Engineer90602 жыл бұрын
how you understood tell me also its totally wrong code ,it is for even no. when you will do it for 21 it will show prime but 21 is not prime....
@hmx213 жыл бұрын
You don't need to check all the way till num, running the loop till num//2 would get you the same result.
@DrRCB3 жыл бұрын
yes. However there is still a shorter range than n/2.
@okechukwuerinne20392 жыл бұрын
I tried this and got a wrong output. I got "4 is a prime number." Perhaps I messed up the program somewhere.
@lolbaba74032 жыл бұрын
@@okechukwuerinne2039 number=2 divisor=2 if number ==divisor or number==1: print("prime number") else: if number%divisor==0: print("Not prine") else: print("Prime") This is code for short range. But when it comes to find prime number in some range then this code is wrong.
@shayaanrk Жыл бұрын
@@okechukwuerinne2039 for such basic exceptions, you should have already added another if statement. if num%2==0 then print False
@omkar15923 жыл бұрын
your voice and explanation both are amazing
@AmulsAcademy3 жыл бұрын
Thank you 😊
@galadimatimothy8025 жыл бұрын
Well done.. Perfectly explained
@AmulsAcademy5 жыл бұрын
Thank you :)
@shruthisagar76777 жыл бұрын
Hi . Very well explained . Easy to understand and solve it Thank You
@AmulsAcademy7 жыл бұрын
Welcome:)
@radiagulzan5 жыл бұрын
Thank you so much! But, what do we do with the input 2 in the end?
@AmulsAcademy5 жыл бұрын
2 is a prime number :)
@darshanchaudhari98363 жыл бұрын
Bro same doubt , did you get the answer
@dudeinspace14913 жыл бұрын
Ur voice keeps entertaining..!
@Pikachu-dw3qk3 жыл бұрын
mam please say how this technique applies if we give input number 2 ??? for other numbers i understood this code perfectly except number 2 case please reply mam
@AmulsAcademy3 жыл бұрын
When input is 2, for loop body will not execute and else part will execute :) In for loop start is 2 and end is 2 so it won’t execute loop body :) And because for loop is not terminated by break statement , else par will execute :)
@Pikachu-dw3qk3 жыл бұрын
@@AmulsAcademy ok mam i got it thanks for the reply
@darthsidious11375 жыл бұрын
Wish I would of found this video a couple hours ago. Had to settle with the brute force method for my assignment.
@unclerojelio63204 жыл бұрын
There is not need to check the for divisors greater than sqrt(num). You can increase the efficiency of this program quite a bit by changing the for loop to: for i in range(2, sqrt(num))
@ganpatinatrajan58902 жыл бұрын
Excellent Explanations...👍👍👍
@trundlingwithjoy22373 жыл бұрын
thank you for this keep up the good work
@AmulsAcademy3 жыл бұрын
Thank you 😊❤️
@rajangymtech.70732 жыл бұрын
Your teching ideas mind blowing
@SanOp-zx1pc Жыл бұрын
this code is wrong input numbers like 27,321,etc... which are not divisible by 2 but are not prime numbers.... still the programme gives the numbers to be prime correct programme code num=int(input('Enter a positive number :')) if num > 1: # Iterate from 2 to n / 2 for i in range(2, int(num/2)+1): # If num is divisible by any number between # 2 and n / 2, it is not prime if (num % i) == 0: print(num, "is not a prime number") break else: print(num, "is a prime number") elif num==0: print(num,'is neither prime nor composite.....') else: print(num, "is not a prime number")
@SanOp-zx1pc Жыл бұрын
@@A4KSHAT Bro is 27 a prime number??? ofcourse not , so how it is showing that it is a prime number
@A4KSHAT Жыл бұрын
@@SanOp-zx1pc i am sorry it is show it is not a prime number
@listentosilently3 жыл бұрын
Video is good #TECH_INTERVIEW_PREPRATION
@AmulsAcademy3 жыл бұрын
Thank you 😊
@listentosilently3 жыл бұрын
🙏🙏🙏
@amansharma-it4df2 жыл бұрын
Very good video you solve me very very big problem thank you very much again
@daniellejdevlin88823 жыл бұрын
Can you explain why number=2 shows up as prime in the code when 2÷2=0? I know 2 is prime
@AmulsAcademy3 жыл бұрын
Check for loop range 😊
@okechukwuerinne20392 жыл бұрын
Thank you so much for this; it was a life saver.
@obulasettyganesh89202 жыл бұрын
🤣🤣🤣🤣
@shivabagareddy91954 жыл бұрын
Good explanation with impressive voice..... Want to listen more of your voice:)
@AmulsAcademy4 жыл бұрын
Thank you :)
@dharmikmistry87814 жыл бұрын
It's very good 👏👏👍
@smartcat5989 Жыл бұрын
mam do you teach in valia ?
@lilyfullery47796 ай бұрын
Too good ❤
@ashishsinha50154 жыл бұрын
mam why you have used else with for loop but not with if
@AmulsAcademy4 жыл бұрын
else case can be used with loops also :) here we need else part with for loop :)
@vidithnarayana23465 жыл бұрын
I like your explanation 👌👌 TQ so much
@jnageswararao85743 жыл бұрын
U voice is good....
@varshacm14444 жыл бұрын
Mam why else is straight under for loop it should be under if know mam plse do reply mam
@AmulsAcademy4 жыл бұрын
We can use else case with loops also. Here we want else part with for loop. The else block just after for/while is executed only when the loop is NOT terminated by a break statement.
@possiblesupport10292 жыл бұрын
Super explaination on the whole youtube
@nareshchoudhary47992 жыл бұрын
How to save it with which name
@pravaalc84094 жыл бұрын
Nicely explained, but if i enter number as 2, the code does not execute. please help
@AmulsAcademy4 жыл бұрын
Thank you :) No it will work properly for input 2.
@pravaalc84094 жыл бұрын
@@AmulsAcademy thank you. noticed indentation was not properly placed in my code
@AmulsAcademy4 жыл бұрын
Yes indentation matters a lot in python :)
@trundlingwithjoy22373 жыл бұрын
maam but if we put 9 it is showing that it is a prime number but as we know that it is not a prime number.....maam how to solve this problem?/
@AmulsAcademy3 жыл бұрын
Give me the program 😊
@deepikamathur94663 жыл бұрын
Nice mam..
@AmulsAcademy3 жыл бұрын
Thank you :)
@paviyug4 жыл бұрын
you explained it very Well
@AmulsAcademy4 жыл бұрын
Thank you :)
@Engineer90602 жыл бұрын
no she explained wrong go for 21,9
@hetanshikothari41774 жыл бұрын
Here i got stuck with case number =2 here 2 modulo 2 will be 0 still it prints 2 is a prime number how does that work
@AmulsAcademy4 жыл бұрын
in the for loop we took range from 0 to num when num=2 range becomes 2 to 2 range(2,2) so it won't execute for loop body :) You can execute this and check for i in range(2,2): print("hello") else: print("hi")
@hetanshikothari41774 жыл бұрын
Amulya's Academy thank you so much for the explanation!! Got it
@ameyashetty14413 жыл бұрын
hey 2 is a prime no but 2%2==0 then how does this work
@AmulsAcademy3 жыл бұрын
Please check for loop range, starting value and end value is same that is 2, so it won’t execute loop body 😊
@nandith1473 Жыл бұрын
@@AmulsAcademy no it's not same it becomes(2,1) right as end value is excluded
@Raja-tt4ll5 жыл бұрын
Great explanation thanks
@AmulsAcademy5 жыл бұрын
Thank you :)
@asrithavardhini9564 жыл бұрын
by writing your code, for number 2 it is not showing anything..please help me
@AmulsAcademy4 жыл бұрын
No it will print 2 is prime number. Give me the program i will check for you :)
@asrithavardhini9564 жыл бұрын
Thanks:) it's working...👍😊
@bakrymohamed87114 жыл бұрын
my teacher I think we don't need the break statement so that after the if condition becomes false the for else will work
@AmulsAcademy4 жыл бұрын
The else block just after for/while is executed only when the loop is NOT terminated by a break statement. So you need to break statement here. Note: remove break and try to execute the program.
@bakrymohamed87114 жыл бұрын
@@AmulsAcademy right
@dharshinimagesh95915 жыл бұрын
hi mam, pl write this example with while loop . i hav tried many times but always stuck wit where to give the increment "i=i+1" operator .
@AmulsAcademy5 жыл бұрын
num = int(input(":")) if num > 1: i = 2 while i < num: if (num % i) == 0: print(num,"is not a prime number") break i =i+1 else: print(num,"is a prime number") else: print(num,"is not a prime number") :)
@dharshinimagesh95915 жыл бұрын
@@AmulsAcademy thank u very much . can u pl tel me wats wrong in this code n if possible could u correct it ?
@dharshinimagesh95915 жыл бұрын
lower=int(input("lower no ")) upper=int(input("upper no ")) i = 2 for num in range (upper,lower+1): while i < num: if (num % i) == 0: print(num,"is not a prime number") break i =i+1 else: print(num,"is a prime number") i want to print prime no's in the intervals like this, without two for loops ..
@AmulsAcademy5 жыл бұрын
lower=int(input("lower no ")) upper=int(input("upper no ")) for num in range (lower,upper+1): i=2 while i < num: if (num % i) == 0: #print(num) print(num,"is not a prime number") break i =i+1 else: print(num,"is a prime number") Try this :)
@dharshinimagesh95915 жыл бұрын
@@AmulsAcademy thank u very much mam . I've identified my mistake 🙏 u dont believe me , i have been fighting with this prime no's prg for past TEN days and I've found ur videos accidentally and i havnt expected this much response from u . u r really a respectful and a responsible teacher .🙏
@mika44443 жыл бұрын
how to check the number is a prime number in a range entered by the user????
@AmulsAcademy3 жыл бұрын
Give me an example :)
@mika44443 жыл бұрын
@@AmulsAcademy for example...user enters the starting range and ending range...from that range we have to find which numbers are prime numbers.
@tuomasbazzan15233 жыл бұрын
Thank you
@AmulsAcademy3 жыл бұрын
Pleasure :)
@Unidentifying4 жыл бұрын
How to do this without using break ?
@shivprakashyadav38143 жыл бұрын
why else is used for for loop not for if
@AmulsAcademy3 жыл бұрын
We can use else case with loops :)
@bhavithasulax.3 жыл бұрын
Mam how can we print those prime numbers
@RK-jv3kw4 жыл бұрын
Are u from tamil nadu ? i understood well thanks for the video
@AmulsAcademy4 жыл бұрын
No I am from Karnataka. Thank you :)
@RK-jv3kw4 жыл бұрын
@@AmulsAcademy i am from kerala, i can easly recognise south indains
@AmulsAcademy4 жыл бұрын
Hello :)
@RK-jv3kw4 жыл бұрын
@@AmulsAcademy hello
@RK-jv3kw4 жыл бұрын
you are nice teacher
@urvi232 жыл бұрын
Mam if we check no 2 how it will work?
@seaofplatitudes7802 жыл бұрын
I was wondering the same thing.
@gayathri-8-i6s3 жыл бұрын
Sisy.. plz put videos for sum of next 2 consecutive numbers
@AmulsAcademy3 жыл бұрын
Will try 😊
@umairgillani6996 жыл бұрын
how about if we want to check the list of prime numbers in a range x to y, where x and y could be any range..
@AmulsAcademy6 жыл бұрын
I did make a video on how to print prime numbers in particular range please check that :)
@umairgillani6996 жыл бұрын
@@AmulsAcademy Yes watched it. It makes a good logic. Please come up with more videos like these :)
@nishasrinivasan46214 жыл бұрын
Thank you so much for this
@AmulsAcademy4 жыл бұрын
My Pleasure :)
@uk0707raptor2 жыл бұрын
Mam this code is not working for number 2.
@sandeepsinghnegi92206 жыл бұрын
please help i am getting 55 as prime number. by writing below code. num= int(input("enter any number")) for i in range(2, num): if (num % i) == 0: print (num,' number is not prime') break else: print (num,' number is prime') break
@AmulsAcademy6 жыл бұрын
num= int(input("enter any number")) for i in range(2, num): if (num % i) == 0: print (num,' number is not prime') break else: print (num,' number is prime') Now check whether it will give correct output or not :)
@sandeepsinghnegi92206 жыл бұрын
num = int(input("enter number to check prime number : .. ")) for i in range(2,num): if (num % i ) == 0: print (num,"not prime") break else: print(num,"number is prime")
@aniketpatil17373 жыл бұрын
I am watching this masterpiece in Dec 2021
@kairu93734 жыл бұрын
Even or Odd and Prime or Composite numbers are different programming logics. What you are trying to imply in here is that every number divisible by 2 is not a Prime number when 9, 15, 21 and so on are not Prime numbers and are not divisible by 2. This is unclear and confusing. The way the tutorial is being discussed has never changed and is still the same as other content creators stating they found the answer behind Prime number logics.
@Engineer90602 жыл бұрын
you are the only one in the comment whom i found have some knowledge, other than people here are saying they are clear , its just a soln for even no. not for prime no.
@KimTae470162 жыл бұрын
I was also confused that by using this method it will print prime statements even for odd numbers..
@Sandeep-sh7uc7 ай бұрын
You wrote print(num,"is not a prime number" ) in FOR loop why it is not printing for num number of times
@crewmate30314 жыл бұрын
Mam why did u use break. Can u tell me the use of it please 🙏🙏
@AmulsAcademy4 жыл бұрын
if you want to exit from the loop then you can use break inside the loop. Execute the program without break you can see the difference :)
@crewmate30314 жыл бұрын
@@AmulsAcademy oo ok mam thanks
@SevenStepsAhead2 жыл бұрын
its remainder not reminder lmao
@ajithkumarm94465 жыл бұрын
Mam, why are u using for loop for all program?
@AmulsAcademy5 жыл бұрын
If you want you can use while loop also. :)
@prasanthkrishnam624 жыл бұрын
How to get a preceding number of a given number
@AmulsAcademy4 жыл бұрын
input-1 :)
@vishaljat43983 жыл бұрын
Thank you❤
@tanweerkarzai73553 жыл бұрын
withought using breal ,how to solve it
@byjusCOM-pw7xn5 жыл бұрын
Ur range function is not working may I know the reason
@bibekanandasahoo34973 жыл бұрын
How I write this code in list comprehension method
@jeetgupta22864 жыл бұрын
Thank u didi ❣️❣️🙏🙏
@AmulsAcademy4 жыл бұрын
Most welcome 😊
@totansarker54604 жыл бұрын
wow.. thank you very much.
@AmulsAcademy4 жыл бұрын
You are most welcome :)
@aryavs45556 жыл бұрын
may i give u a suggestion pls run the programme and show us the output it will ensure that ur codes are correct
@AmulsAcademy6 жыл бұрын
Thank you for the suggestion:) Didn't i show the output in this video? Usually i do execute my program. :)
@zizo87376 жыл бұрын
Arya V S Watch the video properly she has shown the execution
@yadavj122 жыл бұрын
Hello dear we have to find out a prime number or not means there is three conditions can you please explain those three conditions
@pillarikala2664 жыл бұрын
Plz tell with while loop
@muskaangupta49152 жыл бұрын
% k bd wala else iff k indention m aan chahiy th na jo for k nicje ku aara
@kryptonboron61044 жыл бұрын
Mam...it is not working for *21* . What to do? But thanks for the video mam
@AmulsAcademy4 жыл бұрын
21 is not prime number right ? What is the problem ? :)
@kryptonboron61044 жыл бұрын
Mam....When I entered 21, then it checks and says that *21 is prime* . Then I again tried designing a new code for it. Thanks for your reply mam😄
@itzscytesalpha29633 жыл бұрын
Nice vid
@AmulsAcademy3 жыл бұрын
Thank you :)
@TJ-wo1xt3 жыл бұрын
nice one.
@ananddarshan11143 жыл бұрын
then why the hell my program says 9 and 15 are prime number when i write the same program as yours.
@swatimaskawade53213 жыл бұрын
can't we add int in the input statement ?🤔🤔🤔🤔🤔🤔
@maassterpiece5 жыл бұрын
Madam I following your classes daily I am big fan of u yesterday I attended one interview I passed written test In second round they conducted system test But they gave to me a difficult task That task name is FLAMES I HOPE YOU KNOW THAT FLAMES CONCEPT before he conduct the system test He explained to me that FLAMES Take two persons name Cancel that common letters Count the remaining Letters For example total remaining letters are:(5) How to get this out put By using ptython code Plz explain this out madam
@AmulsAcademy5 жыл бұрын
Try this: str1 = input("name1:") str2 = input("name2:") for i in str1: for j in str2: if i==j: str1=str1.replace(i,"",1) str2=str2.replace(i,"",1) print(i,j) print(str1,str2) print("remaining characters in str1:",len(str1)) print("remaining characters in str2:",len(str2)) :)
@ramurachineni22553 жыл бұрын
How to do same program with while loop
@itzboyon69834 жыл бұрын
but if i input 2 it comes out nothing, i know it is a prime number
@kratishrivastava69847 жыл бұрын
plz tell me if num = 2
@AmulsAcademy7 жыл бұрын
2 is a prime number:)
@babusingh78376 жыл бұрын
there is some mistake in your code see carefully
@vasudevareddy67495 жыл бұрын
@kumari sonali ,code is working fine,give lower bound as 2,then it will print including with 2
@rashikrishna15382 ай бұрын
1. Ask the user to input a number. 2. If the number is
@anshumanchoudhary26582 жыл бұрын
a=int(input("enter:")) if (a%2==0) or (a%3==0): print("it is not prime number") else: print("it is prime") this is write or wrong
@anusmitasamanta26085 жыл бұрын
amazing ...
@AmulsAcademy5 жыл бұрын
Thank you :)
@vickykolle88216 жыл бұрын
Wt happend if we not type a break
@AmulsAcademy6 жыл бұрын
you won't get proper output:) When we get divisor of given number then we know that number is not prime so we need to come out of the loop that's why we used break :)
@nabeelmalik.47145 жыл бұрын
If we use negative value then error occur...
@rahuljuneja11856 жыл бұрын
According to your code,it starts dividing by 2. So,2%2==0 Then according to your code,2 should not be a prime number
@AmulsAcademy6 жыл бұрын
No because in the for loop range will become 2 to 2 at that time . so it won't execute for loop directly goes to else part :)
@rahuljuneja11856 жыл бұрын
Amuls Academy Thanks.
@rohitjoshi17775 жыл бұрын
@@AmulsAcademy Did not understood range become 2 to 2 at that time
@gowthamselvaraj7793 Жыл бұрын
Please explain Circular prime number in python mam
@manuaugustine7505 жыл бұрын
try 15 and see what output you will get
@AmulsAcademy5 жыл бұрын
15 is not prime number :)
@ryder30993 жыл бұрын
One correction it is remainder not reminder
@ahinav.s19252 жыл бұрын
Thanks
@Engineer90602 жыл бұрын
wrong concept .plz correct it acc to uyou when i will take 21 as ainput it will show it is prime no. as 21%2==1 but 21 is not a prime nno. ur soln is for even no.
@r4d1calwr4th75 жыл бұрын
try 15 it is showing a prime no.
@AmulsAcademy5 жыл бұрын
No it won't print 15 as prime number :)
@gandrakavya82013 жыл бұрын
thank you mam!!!....ur vedios make me to solve programs on my own :)
@addictedroaster15733 жыл бұрын
Instead of this large code.. We can do.. Num modulus 2 Or 3....remainder not eaual to 0 then it's PRIME NUMBER
@AmulsAcademy3 жыл бұрын
That’s what we are doing here 😊
@addictedroaster15733 жыл бұрын
@@AmulsAcademy please make video on python interview programming question.. But not mcq... Something like paragraph narrated question.... Need it because I am final year student.. Please
@Engineer90602 жыл бұрын
@@AmulsAcademy sry but i thinks its a wrong code bcz for 21,9 it will show prime.
@swathinagarajan48043 жыл бұрын
Tq mam
@AmulsAcademy3 жыл бұрын
Pleasure 😊
@Aaron_duckroast3 жыл бұрын
TYSM!!
@AmulsAcademy3 жыл бұрын
Pleasure :)
@bloodbath88044 жыл бұрын
while True: print(" thankyou very much")
@AmulsAcademy4 жыл бұрын
Welcome :)
@nagarani.g16944 жыл бұрын
plese insert by with alagorithm
@vodka_and_chopsticks85864 жыл бұрын
not gonna work with big numbers like 150, the python will crash, because there will be too many loops
@shivameher37874 жыл бұрын
if num=2 then the remainder will become zero so how it is a prime anyone??
@AmulsAcademy4 жыл бұрын
when num=2 it won't execute the for loop body. range(2,num) so it will become range(2,2) it won't give any value. :)
@itsmeaman1434 жыл бұрын
So what shall we do ao that it get printed 2 is a prime number?
@arrceusx4 жыл бұрын
@@itsmeaman143 set the range from (2, num//2) it"ll return 2 as prime
@komaljaswani74975 жыл бұрын
Hi! Can you please make a video on the question: If a list in python has mix of strings & numbers, how will you make separate lists of strings & numbers? I saw ord() for getting ASCII code in python & chr() for converting ASCII codes to characters somewhere & tried to use them to get answer of this question but it did not work!! :(
@shayaanrk Жыл бұрын
strings are sortd out by str(input) while numbers are sorted out by int(input)