In this program, we will take a string as input and check if a string has a number or not.
Steps to solve the program
- Take a string as input.
- Create a count variable and assign its value equal to 0.
- Use for loop to iterate over each character of the string.
- If the character is a number add 1 to the count variable.
- Use isnumeric() to check for numbers.
- If in the end count is greater is 0 then the string has a number.
- Print the output.
Output :