You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<ahref="https://www.onlinegdb.com/online_python_compiler">Online Compiler and Debugger</a></p>
5
+
<p><strong>Q1:</strong> Write a program to define a function <strong><em>multiply</em></strong> which get two parameters and returns the product of them.</p>
6
+
<p><strong>Q2:</strong> Write a program to create a function that gets sides of a rectangle and return its perimeter and area.</p>
7
+
<p><strong>Q3:</strong> Write a program to create a function that gets a number <strong><em>n</em></strong> and a value <strong><em>s</em></strong> and prints the value <strong><em>n</em></strong> times as output.</p>
8
+
<blockquote>
9
+
<p>Sample1:<br/>
10
+
I/P:<br/>
11
+
10 <br>
12
+
Hello<br/>
13
+
O/p:<br/>
14
+
Hello<br/>
15
+
Hello<br/>
16
+
Hello<br/>
17
+
Hello<br/>
18
+
Hello<br/>
19
+
Hello<br/>
20
+
Hello<br/>
21
+
Hello<br/>
22
+
Hello<br/>
23
+
Hello </p>
24
+
<p>Sample2:<br/>
25
+
I/P:<br/>
26
+
5 <br>
27
+
1 <br>
28
+
O/p:<br/>
29
+
1 <br>
30
+
1 <br>
31
+
1 <br>
32
+
1<br/>
33
+
1 </p>
34
+
</blockquote>
35
+
<p><strong>Q4:</strong> Write a program to define a function to determine simple interest for given values of Principal, Rate p.a. and duration in years.<br/>
36
+
Simple Interest, S.I. = $\dfrac{P \times R \times T}{100}$</p>
37
+
<p><strong>Q5:</strong> Write a program to get a number <strong><em>n</em></strong> and and print the prime numbers from 1 to <strong><em>n</em></strong>. Use function to check if a number is prime or not.</p>
38
+
<p><strong>Q6:</strong> Write a program to define a function to return factorial of the number passed in it (use recursion).</p>
39
+
<p><strong>Q7:</strong> Write a program to define a function to return factorial of the number passed in it (without recursion).</p>
40
+
<p><strong>Q8:</strong> Write a program to define a function that gets a year as input and print if it is a leap year or not.<br/>
41
+
<strong>Condition:</strong> A year is leap if it is either divisible <em>4</em> or <em>400</em> and not <em>100</em>.</p>
42
+
<p><strong>Q9:</strong> Write a program to define a function that returns the permutation of <strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
<p><strong>Q10:</strong> Write a program to define a function that returns the permutation of <strong><em>n</em></strong> and <strong><em>r</em></strong>. Use recursion to compute the factorials.<br>
<p><strong>Q11:</strong> Write a program to define a function that returns the permutation of <strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
<p><strong>Q12:</strong> Write a program to define a function that returns the combination of <strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
<p><strong>Q13:</strong> Write a program to define a function that returns the combinations of <strong><em>n</em></strong> and <strong><em>r</em></strong>. Use recursion to compute the factorials.<br>
<p><strong>Q14:</strong> Write a program to define a function that returns the combinations of <strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
<ahref="https://www.onlinegdb.com/online_python_compiler">Online Compiler and Debugger</a></p>
5
-
<p><strong>Q1:</strong> Write a program to define a function <strong><em>multiply</em></strong> which get two parameters and returns the product of them.</p>
6
-
<p><strong>Q2:</strong> Write a program to create a function that gets sides of a rectangle and return its perimeter and area.</p>
7
-
<p><strong>Q3:</strong> Write a program to create a function that gets a number <strong><em>n</em></strong> and a value and prints the value <strong><em>n</em></strong> times as output.</p>
8
-
<blockquote>
9
-
<p>Sample1:<br/>
10
-
I/P:<br/>
11
-
10 <br>
12
-
Hello<br/>
13
-
O/p:<br/>
14
-
Hello<br/>
15
-
Hello<br/>
16
-
Hello<br/>
17
-
Hello<br/>
18
-
Hello<br/>
19
-
Hello<br/>
20
-
Hello<br/>
21
-
Hello<br/>
22
-
Hello<br/>
23
-
Hello </p>
24
-
<p>Sample2:<br/>
25
-
I/P:<br/>
26
-
5 <br>
27
-
1 <br>
28
-
O/p:<br/>
29
-
1 <br>
30
-
1 <br>
31
-
1 <br>
32
-
1<br/>
33
-
1 </p>
34
-
</blockquote>
35
-
<p><strong>Q4:</strong> Write a program to define a function to determine simple interest for given values of Principal, Rate p.a. and duration in years.<br/>
36
-
Simple Interest, S.I. = $\dfrac{P \times R \times T}{100}$</p>
37
-
<p><strong>Q5:</strong> Write a program to get a number <strong><em>n</em></strong> and and print the prime numbers from 1 to <strong><em>n</em></strong>. Use function to check if a number is prime or not.</p>
38
-
<p><strong>Q6:</strong> Write a program to define a function to return factorial of the number passed in it (use recursion).</p>
39
-
<p><strong>Q6:</strong> Write a program to define a function to return factorial of the number passed in it (without recursion).</p>
40
-
<p><strong>Q7:</strong> Write a program to define a function that returns the permutation of <strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
<p><strong>Q8:</strong> Write a program to define a function that returns the caombinations of <strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
0 commit comments