Mathematics Problem Solving Using Python (3 - 5)

Veröffentlicht am: 16 Juli 2021
auf dem Kanal: FORMAL INFINITY
2,654
17

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 Absolute Beginners related problems in Guvi. We would continue this series of video for covering all the topics under codekata.

If you had been directed to this tutorial access the below specified time tag.
Numbers Question Number 10: 3:34

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.

Video link :    • Mathematics Problem Solving Using Python (...  
Subscribe: https://www.youtube.com/channel/UCPN5....

And If you haven't checked Playlists available in our channel, The link for all the available playlists is given below:

Absolute Beginners : https://youtube.com/playlist?list=PLP...

Basics : https://youtube.com/playlist?list=PLP...

Strings : https://youtube.com/playlist?list=PLP...

Arrays : https://youtube.com/playlist?list=PLP...

Input & Output Functions : https://youtube.com/playlist?list=PLP...

Numbers : https://youtube.com/playlist?list=PLP...

If you have any queries related to problem solving (or) encounter difficulties while coding in Python, You may contact me through Gmail.

Contact id: askdoubtshere@gmail.com
_________________
Question 1:-
You are given a task to tell whether the number is pure or not. A pure number is a number whose sum of digits is multiple of 3.
O(1) time and O(1) space
Input Description:
You are given a number n.
Output Description:
Print yes if it is pure else not
Sample Input :
13
Sample Output :
not
************
a = input()
r = 0
for i in a:
r += int(i)
if r % 3 == 0:
print('yes')
else:
print('not')
_________________
Question 2:-
You are given a set of numbers, out of which you have to tell which of them are finest. A finest number ‘n’ is a number which is formed by a number ‘t’ such that
n=t^3+(t+1)^3
 
t is a natural number
Input Description:
You are given a number ‘z’ representing total numbers in an array, Next line contains z space separated numbers.
Output Description:
Print the numbers which are finest in ascending order if there are no such numbers print -1.
Sample Input :
2
1729 189
Sample Output :
189 1729
***********
a = int(input())
arr = list(map(int, input().split()))
lst = []
form = 1
for i in arr:
for j in range(1,100+1):
form = j**3 + (j+1)**3
if i == form:
lst.append(i)
lst.sort()
print(*lst)
_________________
Question 3:-
You are given a number ‘n’. You have to tell whether a number is great or not. A great number is a number whose sum of digits let (m) and product of digits let(j) when summed together gives the number back
m+j=n
 
Input Description:
You are given a number n;
Output Description:
Print Great if a number is great else print the no
Sample Input :
59
Sample Output :
Great
**********
n = int(input())
t = n
d = 1
r = 0
p = 1
while(n 'is greater than' 0):
d = n%10
r += d
n = n//10
p = d*p
A = r+p
if A == t:
print('Great')
else:
print('no')
_________________
Question 4:-
You are given an array of non-negative integers representing height of walls at index i as Ai and the width of each block is 1. Compute how much air can be encapsulated between the walls of chamber.
 
Input Description:
Each line contains an integer ‘N’ denoting the size of the array Next line contains N space separated numbers to be stored in array.
Output Description:
Output the total unit of Air encapsulated between the walls of chamber.
Sample Input :
3
7 4 9
Sample Output :
3
***********
nos = int(input())
numlist = list(map(int, input().split()))
lower = numlist[0]
if numlist[nos-1] 'is lesser than' lower:
lower = numlist[nos-1]
air_in = 0
for ele in numlist[1:nos-1]:
if ele 'is lesser than' lower:
air_in += lower - ele
print(air_in)


Stock Videos by target="_blank" href="http://www.videezy.com/" Videezy!

Free Stock Footage by href="http://www.videezy.com" Videezy!


Auf dieser Seite können Sie das Online-Video Mathematics Problem Solving Using Python (3 - 5) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer FORMAL INFINITY 16 Juli 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,654 Mal angesehen und es wurde von 17 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!