An Interesting Cipher: More on Strings
HTML-код
- Опубликовано: 3 май 2021
- An Interesting Cipher: More on Strings
"Week: 2
Topic: An Interesting Cipher: More on Strings" IIT Madras welcomes you to the world’s first BSc Degree program in Programming and Data Science. This program was designed for students and working professionals from various educational backgrounds and different age groups to give them an opportunity to study from IIT Madras without having to write the JEE. Through our online programs, we help our learners to get access to a world-class curriculum in Data Science and Programming.
To know more about our Programs, please visit :
BSc Degree in Programming and Data Science - onlinedegree.iitm.ac.in/
Diploma in Programming / Data Science - diploma.iitm.ac.in/
watching this with the knowledge of loops is torture xD
@@rahulfederer20 because this is painful to look at when you already know all of this can be done in 2-3 lines using loops. not only is it small but also more soft-coded (as opposed to hard-coded) and considered a good programming practice. People who dont know programming already are not expected to know all this in week 1 or 2, so dont worry about it too much. once you learn it in future weeks, it would be clear.
Especially with a Java background lol XD
Ok Einstein, no need to make a fuss about that here
@@roshanekka9687 lol, there's nothing special about it, wait for 1 or 2 more weeks you'll learn that yourself. And stop taking everything as an attack lol chill.
@@sayanghosh6996 Watch at 2x....
थैंक्यू
Good class compared to the other sir
nice pedagogy
better to use ord() , chr() functions
@ 20:40 what was that error with Capital "I", why it need to change by small i???
because 'I' is not present in alpha. String alpha is a collection of alphabets in small cases only.
whenever I see joe I just say, "Hey, How you doin'?"
9:50 This can be also done like this
alpha='abcdefghijklmnopqrstuvwxyz'
name="manish"
nname=''
for i in name:
ind=alpha.index(i) +1
nname+=alpha[ind]
print(nname)
alpha = 'abcdefghijklmnopqrstuvwxyz'
name = input("Enter your name:")
new_name = ''
for i in name:
k = (alpha.index(i)+1)%26
new_name += alpha[k]
print(f"
{new_name}")
your code was breaking at "z" so i fixed it with some more additions like an input from user :)
But loops are not explained yet
@@cookietree5625why in print function the f exists. Plz reply
@@nighteagle5529Its a format specifier.
@@cookietree5625 alpha = "abcdefghijklmnopqrstuvwxyz"
name=input("Enter your name - ")
updated_name= ""
for i in range(len(name)):
k = alpha[((alpha.index(name[i]))+1)%26]
updated_name+=k
print(updated_name)
Why % 26 is added ?
As per my understanding what if the name is "zoo".? we want ith+1 letter. So we want a z+1 letter. it's a. so 26%26 = 0 and we will get 'a'. (Maybe I am wrong, please correct me if I am)
you are absolutely right 👍
@@amanpetwal9760 hmm. NIT + IIT. BigBrain :)
@@raj_patel thanks brother ❣️
Is this included in week 1
This is from Week 2, precisely L2.7
@@avenumadhav3568 sir are you a student of diploma or Degree or Foundation. I see you time stamped a lot of lectures from the different subject.
Thanks for helping us out🙏
Too much sound echo is there. Bad quality mic