+ 5
I need a big hand to tell me how to take string with all characters and remove special characters from it and leave letters only
// user gives us any string character with special characters included to encrypt it num = str (input ()) String1= "abcdefghijklmnopqrstuvwxyz" lengthNum = len(num) lengthstr1 = len(string1) i =0 for num[i] in string1 if
35 Respostas
+ 8
Calvin Thomas
brilliant 🤣🤣🤣
+ 8
Ermias Bibi Here are two possibilities:
#1
inp = input()
out = "".join(x for x in inp if x.isalpha())
print(out)
#2
print(*filter(str.isalpha, input()), sep="")
# Hope this helps
# Happy coding!
+ 6
Calvin Thomas godfather, genius, mad,sir
... made my day
... very clever
... could u explain please
... please with loops, my teacher wants it...
but we sometimes forget that what we think is allday python was magic for ourselves when we made our first steps.
+ 6
print("".join(c for c in input() if ord(c) in range(65, 91) or ord(c) in range(97,123)))
+ 3
Ermias Bibi How about using string slicing to reverse the text? :- text[::-1]
+ 3
Calvin Thomas u are not responsible for students or other sololearners.
If you like to post the solution then do it.
It is a nice snack sometimes.
and this one might not be homework.
+ 3
Calvin Thomas you know that my whole night is ruined by code challenge losses . Sorry fo the misunderstanding !!!!!
+ 3
# WELCOME TO HAMDAMBEK NOMOZOV's IDEA))
# user gives this word
user_str_all = input("Enter your words: ")
# this is a key word
key_word_that_we_need = input("Enter main word: ")
len_user_str_all=len(user_str_all)
len_key_word_that_we_need=len(key_word_that_we_need)
# we search key word in all word
if key_word_that_we_need.find(user_str_all):
print("\n -------- success-------\nKeyword is available in word")
#in order to clear and understanding we can change key word to *
new = user_str_all.replace(key_word_that_we_need,"*")
print("Without keyword:"+new)
str = list(new)
x=-1
print(str)
for i in str:
x=x+1
if i =="*":
print(f"Keyword index position: {x}")
else:
print("not success")
+ 2
Ermias Bibi nope!
lets say it was homework.
(just as assumption)
On the one hand posting homework is not allowed and mods markForDeletion.
on the other hand it is a little brainteaser and appeals to be solved. And post solution....
knowing it is not correct.
🤔🤔🤔haaarg lets post
+ 2
Ermias Bibi 😭😭😭😭
😂😂😂😂
at least not youe whole life.
+ 2
Enter your words: sdfaskkdsada
Enter main word: kk
---------- success----
Keyword is available in word
Without keyword:sdfas*dsada
['s', 'd', 'f', 'a', 's', '*', 'd', 's', 'a', 'd', 'a']
Keyword index position: 5
+ 2
txt = input()
txt = "".join([x for x in txt if x.isalpha()])
+ 1
Would you show me ?
+ 1
Ermias Bibi I've already shown you.
+ 1
Hahaha big sorry I was so dumb these hours . I lost 500 xp on code challenge
+ 1
When I run your code on the spy life code in sololearn , it couldn't give the right output
+ 1
Calvin Thomas !!! you are brilliant
You make my night so bright
+ 1
Oma Falk I don't know what all people tend to say when I give them the solutions. God knows how much of an exaggeration I'd have to face...
+ 1
Oma Falk The Knighthood given by all those gimme-the-solutions-without-making-me-take-a-bit-of-an-effort people makes me feel like a huge hypocrite. I guess that I should stop posting solutions here.
+ 1
Calvin Thomas I think that is hasty generalization to frame us all as hypocrite