Python Programming: Sample Programs, Solutions, Programming, and Coding.
https://tinyurl.com/practiceproblems1001
Click on the above link to get the notes of this video.
This video demonstrates the solutions for ten different problems. It includes the process of finding a solution, algorithm, step-by-step procedure, and demonstration as well. The following are the questions that are covered in this video:
1. A circle has been drawn with a radius ‘r’. Some needs to find the area of a circle and its perimeter as well. You should create ‘constant.py’, for PI value instead of giving a value 3.14 in this file.
2. A number is said to be even or odd based on the remainder obtained after dividing it with the value of two. If it is divisible, then it is called ‘even’. Otherwise, ‘odd’. Now, Mr. X wanted to know the same without using any arithmetic operators.
3. In a class there are ‘n’ students and the faculty wanted to distribute ‘c’ chocolates among the students based on their intelligence in such a way that:
The one with least intelligence will receive ‘k’ chocolates.
Based on their intelligence the next level students will receive k+1, k+2, …. Chocolates. Similarly, the one with highest intelligence receives k+n chocolates.
In this regard, how many chocolates ‘c’ are to be purchased to distribute for ‘n’ students if the least intelligence student is getting ‘k’ chocolates. Moreover, if the cost of each chocolate is ‘r’ rupees, then what is the total amount that the faculty should spent on chocolates.
4. It is always easy to find the least common multiplier LCM by finding the highest common factor HCF of two given numbers. It can be done by using division method. For instance, if two numbers ‘n1’ and ‘n2’ are given with the values of 108 and 30, then the process of finding GCD is given below:
Step-1: 108/30 Q =3 and R=18 change n1=30 and n2=18 since R ≠0
Step-2: 30/18 Q =1 and R=12 change n1=18 and n2=12 since R ≠0
Step-3: 18/12 Q =1 and R=6 change n1=12 and n2=6 since R ≠0
Step-4: 12/6 Q=2 and R=0 GCD = 6 since R=0
Now find the LCM as n1*n2/GCD 108*30/6 = 540.
5. A decimal number ‘d’ can be represented in binary form as b_n-1,b_n-2,…,b_2,b_1,b_0 . It can be achieved by using division method. For instance, if ‘11’ is the decimal number considered, then the equivalent binary number would be ‘1011’. The process of converting 11 to 1011 is given below:
Step 1: 11/2 - Q = 5 and R = 1
Step 2: 5/2 - Q = 2 and R = 1
Step 3: 2/2 - Q = 1 and R = 0
Step 4: 1/2 - Q = 0 and R = 1
You should stop the iteration if Q value is equal to ‘0’. Now the binary value is to be constructed by combining the R values form bottom to top and is equal to ‘1011’.
Write a program to find the length of binary values for a given decimal number ‘d’.
For instance, if ‘d’ is 11, then the length is 4. If ‘d’ is 61 then the length is 6.
6. Mr. RAM must travel in call taxi ‘c_t’ from his home to office everyday of a distance ‘d’. The driver will charge based on the instructions that are given below:
Instructions:
The charges are of ‘r’ rupees for first ‘k’ kilometers.
Afterwards, 70% of the ‘r’ rupees for the next ‘k+4’ kilometers.
Afterwards, 50% of the ‘r’ rupees for the rest of ‘y = d-k-k+4’ kilometers.
How much r he should pay to the driver of ‘c_t’ for the given parameters ‘y’, ‘d’, and ‘k’.
7. Mr. John is a programmer and want to find the total number of vowels entered by the user by iteratively reading the input. If the user enters -1, then John wants to terminate the program and prints the total number of vowels entered by user.
In this regard, can you provide a logic for john?
8. A number ‘xy’ stands for a two-digit Hexa-Decimal integer. Now, Mr. Raman wants to separate them as x and y with using only bit-wise operators. He is recruiting the people based on the solution given to the problem.
For instance, if 0xA9 is the hexa-decimal number, then the output should be 0x0A and 0x09. The one should achieve the same without using any other operators except bit-wise operators.
9. A rectangle ‘r1’ can be drawn with two parameters called length l1 and width w1. Consider another rectangle ‘r2’ has been overlapped on ‘r1’ with parameters called length l2 and width w2. Can you find the length ol and width ow of the overlapped rectangle or.
A number x is given with some decimal value and one must find its half and double without using arithmetic operators.
10. For instance, if the given value is ‘512’ then its half is equal to 256 and its double is equal to 1024.
It is easy to declare the variable and assign a value for it. After assigning some value to the variable, I would like to change the assigned value to 0. It should happen with one statement that too not using any arithmetic and assignment operators.
11. For instance, the output of the following code should be zero.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python Programming: Sample Programs, Solutions, Programming, and Coding.», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.