write a python program to check whether a digit is present in the number
Answers
Answered by
1
Answer:
How to check if a string contains a number in Python
- contains_digit = False.
- s = "abc1" Example string.
- for character in s: Iterate over `s`
- if character. isdigit(): Test for digit.
- contains_digit = True.
- print(contains_digit)
Similar questions