I have 2 string exercises which are making me hate programming with python from the heart as they are suppose to be as easy as returning 1+1. def pairs(txt): if len(txt)%2==0: right_indexes=list(range(1,len(txt),2)) print(right_indexes) left_indexes=list(range(0, len(txt), 2)) print(left_indexes) right_letters=map(list(txt).__getitem__,right_indexes) left_letters=map(list(txt).__getitem__,left_indexes) pairs=list(zip(left_letters,right_letters)) return pairs I've ended up creating this list of paired tuples thinking it might help me understand better as I noticed how comparing 2 things next to each other. Because if the number of things is odd at the right side edge, it's not easy for me to know what to do. But it's not helping me to solve these very simple problems as I have no idea how to implement a for or while loop from pairs [(A,B),(B,C),(A,B),(C,C),(C,D)] for these 2 exercises: 1)Make a function that removes letters that are alone. Like if you have like ABBCABCCCD it would return BBCCC 2)Make another function which does the opposite turning like ABBCABCCC returns ACABD removing duplicates alight together (not just all). my brain only works to turn the whole thing into a set... ;____; When things are like this and you truly have to understand loops.... plus conversion as one is suppose to input a string and output should be a string.... I really feel like I'm the dumbest person alife Please help me solve these.
Sir I want to print if given character is a vowel or not, please suggest the correction. Def vowels(char): achar='aeiou' If char=achar: Print ("it's a vowel") Else: Print("it's a consonant") Print(vowels('f')
Sir, In Repetition:- a = murthy b = 3 c = a * b print(c) output:- (murthymurthymurthy) But I want the expected output as (murthy murthy murthy) Can you explain it
I am learning C programming concepts though your UA-cam videos only Sir... Great work...
Thank you sir for giving great information to us sir ......really its great thing sir once again thank you so much sir
thanks alot the video is 2years old and we are still learning from it, god bless you
Your explanation is very very nice
Very nice explanation sir ❤❤❤
thanku so much sir, this one helped a lot
thanku sir
I have 2 string exercises which are making me hate programming with python from the heart as they are suppose to be as easy as returning 1+1.
def pairs(txt):
if len(txt)%2==0:
right_indexes=list(range(1,len(txt),2))
print(right_indexes)
left_indexes=list(range(0, len(txt), 2))
print(left_indexes)
right_letters=map(list(txt).__getitem__,right_indexes)
left_letters=map(list(txt).__getitem__,left_indexes)
pairs=list(zip(left_letters,right_letters))
return pairs
I've ended up creating this list of paired tuples thinking it might help me understand better as I noticed how comparing 2 things next to each other. Because if the number of things is odd at the right side edge, it's not easy for me to know what to do.
But it's not helping me to solve these very simple problems as I have no idea how to implement a for or while loop from pairs [(A,B),(B,C),(A,B),(C,C),(C,D)] for these 2 exercises:
1)Make a function that removes letters that are alone. Like if you have like ABBCABCCCD it would return BBCCC
2)Make another function which does the opposite turning like ABBCABCCC returns ACABD removing duplicates alight together (not just all).
my brain only works to turn the whole thing into a set... ;____; When things are like this and you truly have to understand loops.... plus conversion as one is suppose to input a string and output should be a string.... I really feel like I'm the dumbest person alife
Please help me solve these.
The best teacher🙏
Sir u have covered string fullfledjly...thank u sirr 😊😊
Upload more videos on phyton for beginners Sir......☺
Hello sir please provide next video and previous video in your description then only we can understand easily 🙏
Thank u sir 👍🙏
Tnx a lot sir
Thank you sir
Thank you !!!!!!!
We can reassign the value to string variable right henve can we say string also mutable
Sir I want to print if given character is a vowel or not, please suggest the correction.
Def vowels(char):
achar='aeiou'
If char=achar:
Print ("it's a vowel")
Else:
Print("it's a consonant")
Print(vowels('f')
Use single quotes to all elements in between square braces.then check the output
if char in achar:
Please make change in if conditions. You can Use membership operator inplace of =. Or there could be couple of more ways
Shall we devide string into substring
Lot of confusion in using iterative statements in strings sir 😵😵😵
Sir if possible please share your python notes
str=input(), this did not work when i tried out
Sir, In Repetition:-
a = murthy
b = 3
c = a * b
print(c)
output:- (murthymurthymurthy)
But I want the expected output as (murthy murthy murthy)
Can you explain it
a="murthy "
or print((a+" ")*b)
Thank you sir