Computer Science, asked by nevonj2am, 6 months ago

write a python program to check whether a digit is present in the number

Answers

Answered by arunabalamohapatra
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