filmov
tv
Find whether the given two numbers is co-prime or not using Python in Mathematics (Codekata) 1-2
![preview_player](https://i.ytimg.com/vi/u80Cgn95-7g/maxresdefault.jpg)
Показать описание
Hey guys, Welcome to FORMAL INFINITY Channel, In this video we would discuss the solution for Codekata programing problems using python in Guvi. In this specific video we have discussed Mathematics related problems in Guvi. We would continue this series of video for covering all the topics under codekata.
If you find our videos useful, please like or comment and don't forget to subscribe our channel to follow frequent videos and regular updates posted in our channel.
And If you haven't checked Playlists available in our channel, The link for all the available playlists is given below:
If you have any queries related to problem solving (or) encounter difficulties while coding in Python, You may contact me through Gmail.
_________________
Question_1:-
Find the minimum among 10 numbers.
Sample Testcase :
INPUT
5 4 3 2 1 7 6 10 8 9
OUTPUT
1
******************
arr = list(map(int, input().split()))
print(min(arr))
_________________
Question_2:-
Assume your brother studies in class 2. He has to complete his homework on co-primes. As an elder sibling help him in finding whether the given two numbers is co-prime or not.
Input Description:
You will be given two numbers ‘n’ and ‘m’
Output Description:
Your task is to tell whether numbers is co prime or not. If it is a co-prime print 1 else 0
Sample Input :
3 5
Sample Output :
1
*******************
a,b = map(int , input().split())
arr = []
r = 0
for i in range(1,a+1):
if a % i == 0:
for i in range(1, b+1):
if b % i == 0:
if i in arr:
r += 1
if r 'is grater than'= 1:
print(1)
else:
print(0)
__________________
If you find our videos useful, please like or comment and don't forget to subscribe our channel to follow frequent videos and regular updates posted in our channel.
And If you haven't checked Playlists available in our channel, The link for all the available playlists is given below:
If you have any queries related to problem solving (or) encounter difficulties while coding in Python, You may contact me through Gmail.
_________________
Question_1:-
Find the minimum among 10 numbers.
Sample Testcase :
INPUT
5 4 3 2 1 7 6 10 8 9
OUTPUT
1
******************
arr = list(map(int, input().split()))
print(min(arr))
_________________
Question_2:-
Assume your brother studies in class 2. He has to complete his homework on co-primes. As an elder sibling help him in finding whether the given two numbers is co-prime or not.
Input Description:
You will be given two numbers ‘n’ and ‘m’
Output Description:
Your task is to tell whether numbers is co prime or not. If it is a co-prime print 1 else 0
Sample Input :
3 5
Sample Output :
1
*******************
a,b = map(int , input().split())
arr = []
r = 0
for i in range(1,a+1):
if a % i == 0:
for i in range(1, b+1):
if b % i == 0:
if i in arr:
r += 1
if r 'is grater than'= 1:
print(1)
else:
print(0)
__________________
Комментарии