I love all your tutorials. I see often in the comments some smart code which for a beginner like myself means nothing- maybe,will be valuable in the future, but your tutorials are in depth which drives in my understanding of the programming concepts. Please keep doing what you are doing. Bless you.
Thank you again for another well explained tutorial. It’s not just the method you used to solve the problem but I have gained a better understanding with FOR LOOP watching this video. You’re a great teacher. I am waiting for your next video. Thank you
You all probably dont give a damn but does any of you know of a method to get back into an Instagram account? I somehow lost my account password. I appreciate any tricks you can offer me.
This video is nice, i saw your 4 videos today. But this is great, nice explanation. If you able to make video in hindi it will great opportunity for hindi people just like me, i am not good in english
def reverse(string): reversed_string = "" for i in string: reversed_string = i + reversed_string print("reversed string is:",reversed_string) string = input("enter the string:") print("entered string is:",string) reverse(string) Here first , string = input("enter the string") will be executed, so you need to enter the input, if you enter "amuls" this string will be stored in variable string Next it will execute , print("entered string is:",string) so it will print entered string to the output screen. Next it will execute function call that is, reverse (string) so now control goes to the reverse function definition, so it will execute that function. def reverse(string) here string is the input that is "amuls", next we will take one variable and we assign empty string to that. reversed_string = "" here reversed_string is a variable which will hold final output. next for loop, for i in string: reversed_string = i + reversed_string so here string is "amuls", so initially variable i value will be 'a', so it will execute for loop body , reversed_string = i + reversed_string here we are doing string concatenation, symbol + is used for concatenation of strings. reversed_string is initially empty string and i value is 'a' so it will concatenate 'a'and empty string, so we will get reversed_string as 'a' that is, reversed_string = i + reversed_string = 'a' + "" = 'a' next again control goes to for loop, now i value becomes 'm', it will execute for loop body, reversed_string = i + reversed_string = 'm' + 'a' = "ma" in this same way it will continue the execution:)
thanks for the explanation, at first I was confused too.. reading the string as it was an array like str[I] and in my mind it got the same order.. but now is clear :)
still confused. make the code as reversed_string + i. in this case it will give you the same string as entered initially. the trick is that the i value is cancatenated with reversed string not the other way around.
hi i learn a lot from your videos and check my below code which is more simply than the above one. print("enter anything to be reversed") x=input() length=len(x) for i in range(length-1,-1,-1): print(x[i],end="")
@@PassionateSaksham 1: length-1 means that the for loop will start from the index number which is one less than the length of the string to be reversed 2: -1 is the number untill which the for loop will run 3: -1 is the amount which will be decremented after every iteration and this will continue until the number reaches till -1.
Hello Ma'am,I have started watching your Python programming videos and the sessions were really helpful as you did explained in a nicely manner. Is it possible to navigate all your videos (the concepts + sample program's) please? Also,let me know if any materials are available and then I can take as well if they are chargable?
Try this: def reverse_string(s): if len(s) == 1: return s else: return reverse_string(s[1:]) + s[0] s = input("enter string:") print("The original string is : ",s) print ("The reversed string is : ",reverse_string(s))
Grate Tutorials, But mam when I was learning python functions I was taught not to use print statements in a function or else the user's rights to edit the returned value will end up
Thanks for reply. but why would for loop add m before a like m+a and not standard way a+m? this part is main part and your reply did not make it clear. if one puts 'amuls'[::-1] it makes sense to reverse. But why would x = i+var should loop from left to write rather than from right to left?
hey, In the string concatenation, 'a' + 'm' is 'am' 'm' + 'a' is 'ma' for i in string: reversed_string = i +reversed_string here string is amuls, so first i value becomes 'a' so for loop executes for i='a', so , reversed_string = i +reversed_string [ here, = 'a' + "" = 'a' [ i = 'a' [ reversed-string = '"" [ empty string ] Now reversed_string is 'a' so next i value becomes 'm' reversed_string = i +reversed_string = 'm' + 'a' ='ma' so reversed_string is 'ma' now. here we are doing, i+reversed_string so we get string is reversed order, that is 'sluma' if we write, reversed_string + i we will get the same string, that is "amuls" :)
Hi I have written code like this but i am not able to be executing in python 2.x could you please help me def reverse(str): reversed_str="" for i in str: reversed_str= i+reversed_str print("reversed string is:",reversed_str) str=input("enter a string:") print ("entered string",str) reverse(str)
Because you are using python 2, in the output: first a message will display that is, enter a string: here you need to enter string that is, "amuls" [ you need to write your input within the double quotes ] Because In python 3 input() by default treat input as string. But in python 2 input() will evaluate the input. OR you can write code like this: python 2's raw_input is equal to python 3's input() so instead of input() you can use raw_input() def reverse(str): reversed_str="" for i in str: reversed_str= i+reversed_str print "reversed string is:",reversed_str str = raw_input("enter a string:") print "entered string", str reverse(str) here you can enter input without double quotes:)
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!! :(
I love all your tutorials. I see often in the comments some smart code which for a beginner like myself means nothing- maybe,will be valuable in the future, but your tutorials are in depth which drives in my understanding of the programming concepts. Please keep doing what you are doing. Bless you.
Thank you so much :}
Thank you again for another well explained tutorial. It’s not just the method you used to solve the problem but I have gained a better understanding with FOR LOOP watching this video. You’re a great teacher. I am waiting for your next video. Thank you
Thank you so much :)
I have'nt seen anyone explaining concepts so deeply as you do , It makes learning very easy
thanks mam for your efforts
You are really a very good teacher with clear concept. All your videos are helping me a lot as a beginner. Thank you so much🙏🏻
Glad to hear that :)
Thank you this was very helpful! I like how you went into details of the for loop and explained the logic of it.
Thank you:)
@@AmulsAcademy GREAT VIDEO AND WELL EXPLAINED!!!
@@AmulsAcademy python code to reverse a string without effecting special characters?(Input: ab,c,d)(output:dc,b,a) please reply
You all probably dont give a damn but does any of you know of a method to get back into an Instagram account?
I somehow lost my account password. I appreciate any tricks you can offer me.
@Roman Trenton Instablaster =)
Great Explaination, I was stucked at working of the for loop.
But now it is clear.
Thank You.
now thats what I call explanation. a k.g. boy can understand the program. thanq mam.
Thank you :)
Too good mam🤍...ur voice next level🙌🏻😇.. understood clearly 😍🥰
n =("amuls")
n1=(n[::-1])
print(n1)
there are 5 ways to reverse a string in Python
what does the (n[::-1]) mean? I barely learned python.
@@marioshusband3700 go check slicing of index of a string tutorial.
excellent explanation Ma'am keep it up and keep growing.👍👍👍
A great explained video, very useful for me for better understanding of for loop iteration. Thank you.
Awesome .. explanation.. i really appreciate you.. 👌👌👌
Thank you :)
thank you! i was having a hard time understanding this concept, i really appreciate it! 😀
Nice explanation, amazing teacher you are 💓
Nice and clear explanation.
How to print this sequence:
Input : A B C D
Output : Z Y X W
Try this:
n = input("Enter number of elements : ")
k=65
list1 = n.split()
for i in range(len(list1)):
c = ord(list1[i])-k
h = 25-c+k
print(chr(h))
def reverse(y):
for i in range (1,1+len(y)):
print(y[-i],end='')
reverse("amulse")
why the hell did you pass in 1 at the first place, just use range(len(y)) lmao
@@00xess If he did that he would have to print(y[-i - 1], end='').
First index is 0 but last is -1
#run_this
print(input()[-1::-1])
@@thesumitkumar0 you can ignore -1 in beginning
wonderful! how is crystal clear explanation! very helpful for beginners like for me
Thank you 😊
Great explanation mam👍❤️
Thank you :)
Magnetic voice mam🔥🔥🔥
This video helped me so much! Thank you!
Pleasure :)
thank you very much ma'am ......very easy way of explanation u had given here.....thanks a lot :)
looking many more python videos from you
Thank you :)
way of explanation is too good thank you soo much
My Pleasure :)
So chars are going to be concatenated from right to left? Did I get this right?
Finally! Simple, yet detailed!! Thank you!
Nice explanation, please upload python data science videos
Superb Explanation!!!
amazing explanation till now superb
You are very good and your way is best,keep it up
Thank you :)
Perfect explanation for interview
Fabulous keep going i loved u programmes vry helpful especially during exams😁👍👍👍👏👏👏👏
Thank you:)
U seem kannadiga from Bangalore..lots of wishes from mangalore
thanks for the explanation at the end it was very helpful.
It was a great explanation ma'am
This video is nice, i saw your 4 videos today. But this is great, nice explanation.
If you able to make video in hindi it will great opportunity for hindi people just like me, i am not good in english
I will start the Hindi channel soon :)
@@AmulsAcademy explain django ecommerce website
thank you so much! please make more videos like this its really helping!
Pleasure 😊
Thankyou : For detailed explanation 😊
Pleasure :)
thanks for explaining everything clearly .........thanks a lot........
My Pleasure :)
Very helpful and easy to understand. Thank you
Glad it was helpful!
I just love ur videos buddy
Really great explanation 🙌
How this code reverses the input string? It works but I am not sure if I understood the mechanics of it. Can you explain a little bit more.
def reverse(string):
reversed_string = ""
for i in string:
reversed_string = i + reversed_string
print("reversed string is:",reversed_string)
string = input("enter the string:")
print("entered string is:",string)
reverse(string)
Here first ,
string = input("enter the string") will be executed,
so you need to enter the input,
if you enter "amuls" this string will be stored in variable string
Next it will execute ,
print("entered string is:",string)
so it will print entered string to the output screen.
Next it will execute function call that is,
reverse (string)
so now control goes to the reverse function definition,
so it will execute that function.
def reverse(string)
here string is the input that is "amuls",
next we will take one variable and we assign empty string to that.
reversed_string = ""
here reversed_string is a variable which will hold final output.
next for loop,
for i in string:
reversed_string = i + reversed_string
so here string is "amuls", so initially variable i value will be 'a',
so it will execute for loop body ,
reversed_string = i + reversed_string
here we are doing string concatenation, symbol + is used for concatenation of strings.
reversed_string is initially empty string and i value is 'a'
so it will concatenate 'a'and empty string,
so we will get reversed_string as 'a'
that is,
reversed_string = i + reversed_string
= 'a' + ""
= 'a'
next again control goes to for loop,
now i value becomes 'm',
it will execute for loop body,
reversed_string = i + reversed_string
= 'm' + 'a'
= "ma"
in this same way it will continue the execution:)
great!
Str="David"
str[::-1]
thanks for the explanation, at first I was confused too.. reading the string as it was an array like str[I] and in my mind it got the same order.. but now is clear :)
still confused. make the code as reversed_string + i.
in this case it will give you the same string as entered initially. the trick is that the i value is cancatenated with reversed string not the other way around.
Excellent video. Thanks@!
Pleasure 😊
Very good and neat explanation... Well done...
Really good explanation, Thank you
Glad it was helpful! :)
l,m,n = yell,yem,yen 😂😂😂 ,whatever video was great !
Thank you:)
Yeh it should be el, am ,an for l, m , n any ways great explanation nice voice
the pronunciation differs as per the state
@@MuhammadNaeem-xj8zp Its not about whether it SHOULD BE or whatever. Its totally okay to have a different pronounciation.
Nobodys perfect summbbbhaaavvvvvvvaaa ssuuusssoooddiiiaaaaa so please watch it or get out nobody wants you here anyway
love the way you teach
Thank you :)
Can u make decorator using reverse number and also negative number and also string enter to string reverse in single function
Will try 😊
Nice explanation.. Thanks..
My Pleasure:)
Mam please make a video on ...Any program how it is executed
thank you somuch for this wonderful vedio.how to reverse a word using recursion
Thank you :)
You can use string slicing method and write the program :)
@@AmulsAcademy can you say the program
hi do you have any video about reversal string but in vertical way. i've tried so many ways but still no solution
Thank you so much! That was very helpful!
My Pleasure :)
thank you so much ma'am god bless you !
Thank you mam for clear explanation
hi i learn a lot from your videos and check my below code which is more simply than the above one.
print("enter anything to be reversed")
x=input()
length=len(x)
for i in range(length-1,-1,-1):
print(x[i],end="")
What the Meaning Of -1,-1,-1 Here Please Answer Me
@@PassionateSaksham
1: length-1 means that the for loop will start from the index number which is one less than the length of the string to be reversed
2: -1 is the number untill which the for loop will run
3: -1 is the amount which will be decremented after every iteration and this will continue until the number reaches till -1.
wow, waht an explanation. I wish I get this fot interview
Hello Ma'am,I have started watching your Python programming videos and the sessions were really helpful as you did explained in a nicely manner.
Is it possible to navigate all your videos (the concepts + sample program's) please?
Also,let me know if any materials are available and then I can take as well if they are chargable?
Sorry I don't have any materials
:)
can function name be any keyword here you have written as reverse which i think is reserved word . Pls explain as code is executing
Great 👍 I love it
please how can we solve it with recursion
Try this:
def reverse_string(s):
if len(s) == 1:
return s
else:
return reverse_string(s[1:]) + s[0]
s = input("enter string:")
print("The original string is : ",s)
print ("The reversed string is : ",reverse_string(s))
A million Thanks!
Pleasure 😊❤️
Feels super easy after seeing this
thank you so much.. these is very helpful to me .
My Pleasure :)
Mam make video on c++ and html and core and advance java
Good Explanation
Thank you :)
very good explanation
Thank you :)
Or
>>> string = "amuls"
>>> string[::-1]
it's a simple method
Genius!
this is the right method
you just saved me 8 minutes. thank you, you are a legend
This is inbuilt method which I use oftenly but it doesn't works in complex programs...
Thanks for sharing this!!
clearly understood
Thank you.....
Nice approach
Well explained mam
Thank you 😊
Grate Tutorials, But mam when I was learning python functions I was taught not to use print statements in a function or else the user's rights to edit the returned value will end up
Thanks for reply. but why would for loop add m before a like m+a and not standard way a+m? this part is main part and your reply did not make it clear. if one puts 'amuls'[::-1] it makes sense to reverse. But why would x = i+var should loop from left to write rather than from right to left?
hey,
In the string concatenation,
'a' + 'm' is 'am'
'm' + 'a' is 'ma'
for i in string:
reversed_string = i +reversed_string
here string is amuls,
so first i value becomes 'a'
so for loop executes for i='a',
so ,
reversed_string = i +reversed_string [ here,
= 'a' + ""
= 'a' [ i = 'a'
[ reversed-string = '"" [ empty string ]
Now reversed_string is 'a'
so next i value becomes 'm'
reversed_string = i +reversed_string
= 'm' + 'a'
='ma'
so reversed_string is 'ma' now.
here we are doing,
i+reversed_string
so we get string is reversed order, that is 'sluma'
if we write,
reversed_string + i
we will get the same string, that is "amuls"
:)
Thanks. I got it now. very nice.
def rev(x):
return x[::-1]
rev('forward')
x = input("Enter any name: ")
x[::-1]
Thanku.... Very helpful
Pleasure :)
Hi I have written code like this but i am not able to be executing in python 2.x could you please help me
def reverse(str):
reversed_str=""
for i in str:
reversed_str= i+reversed_str
print("reversed string is:",reversed_str)
str=input("enter a string:")
print ("entered string",str)
reverse(str)
Because you are using python 2,
in the output:
first a message will display that is,
enter a string:
here you need to enter string that is,
"amuls" [ you need to write your input within the double quotes ]
Because In python 3 input() by default treat input as string.
But in python 2 input() will evaluate the input.
OR you can write code like this:
python 2's raw_input is equal to python 3's input()
so instead of input() you can use raw_input()
def reverse(str):
reversed_str=""
for i in str:
reversed_str= i+reversed_str
print "reversed string is:",reversed_str
str = raw_input("enter a string:")
print "entered string", str
reverse(str)
here you can enter input without double quotes:)
Thank you so much!!!!!!!!!!!
welcome:)
whose version use you are?
Perfect 👌
good explanation
nice 👍👍👍👍👍
Thank you :)
Mam make video for those who don't know anything about programing even ABCD of it
Thank you❤
You constructed the solution in a more complicated way which can be solved with the easy loop system.
Nice 👍👍
Thank you :)
thanks for the help
helped me lot
Pleasure :)
Hai mam but getting syntax error like unindent does not match any indentation level what to do pls explain
I think you placed extra space before that statement.
love your voice
Nice explanation
Thank you:)
I think there is not necessary to include function def, For loop is enough to reverse the string. So what's your opinion?
Thank you I understand logic
Pleasure :)
can u upload a video on "reverse" which is used everywhere in python like list and reverse operation on some other.. . . like reversing a list kind of
Are you asking about the list.reverse method?
Pythonic way to reverse a string is to use the slice operator
E.g.
str1 = "Amuls"
rev_str = str1[ : : -1]
:-)
Thanks a lot
Pleasure :)
Good video mam
Thank you :)
Can we do this using while loop
Yes we can :)
def reverse(name):
print(len(name))
for i in range(len(name)-1,-1,-1):
print(name[i],end="")
reverse("Vishal")
Very good thanku
Thank you dear
my python 3.8 compiler for 32 bit does not works
What is the problem? Getting any error ?
yaw i got Idle subprocess did not make connection error
I got it...!!!
thanks
My pleasure:)
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!! :(