- 3

How to delete a certain character(#) when entering?

For example: I entered #20 The program should delete # and print 20

14th Nov 2019, 5:33 PM
Марсель Халимов
2 Réponses
+ 6
You didn't provide any attempts in any of your posts, we don't do homework, show us what you did before you post anything related to a problem in programming, thanks!
14th Nov 2019, 5:56 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
When you enter a values like this, it's string, so you can delete certain char by using `replcae()` and convert it to an integer by `int()` like this: ************************** value = input() value = value.replace("#", "") number = int(value) print(number) ************************** If you enter `#20` as value it prints `20` as output.
15th Nov 2019, 2:33 PM
Mehran sanea
Mehran sanea - avatar