Find whether string s is divisible by string t
Answers
Answered by
0
Answer:
# Python Program to Check Number is Divisible by 5 and 11
number = int(input(" Please Enter any Positive Integer : "))
if((number % 5 == 0) and (number % 11 == 0)):
print("Given Number {0} is Divisible by 5 and 11".format(number))
else:
print("Given Number {0} is Not Divisible by 5 and 11".format(number))
Explanation:
Answered by
0
Python program and the output for the above question is listed below:
Output :
If the user input as "SSN" and "SSN", then it will prints that the string is divisible.
If the user input as "SSN" and "SSn", then it will prints that the string is not divisible.
Explanation:
S=input("Enter the value for string s: ")#take the value from the user for the string S.
t=input("Enter the value for string t: ")#Take the value from the user for the string t.
if(S==t):
print("The string S is divisble by the string T")#print that the string is divisble or not.
else:
print("The string S is not divisble by the string T")
Code Explanation :
- If there are two string and if the string is the same in the capital or small then only the string can be divisible.
- So if the user enters the same string then only it can be divisible, otherwise, it can the divisible.
- So the above python program also used to take the string and then compare it in the comparison of case sensitive and letters.
Learn More :
- Python : https://brainly.in/question/14689905
Similar questions
English,
5 months ago
Chemistry,
5 months ago
India Languages,
10 months ago
Computer Science,
10 months ago
Math,
1 year ago