Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5608336

Browse files
Updated questions
1 parent 8197f88 commit 5608336

File tree

5 files changed

+241
-77
lines changed

5 files changed

+241
-77
lines changed

‎.ipynb_checkpoints/Practice_code4-checkpoint.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Try working online at:
88

99
**Q2:** Write a program to create a function that gets sides of a rectangle and return its perimeter and area.
1010

11-
**Q3:** Write a program to create a function that gets a number ***n*** and a value and prints the value ***n*** times as output.
11+
**Q3:** Write a program to create a function that gets a number ***n*** and a value ***s***and prints the value ***n*** times as output.
1212
>Sample1:
1313
I/P:
1414
10 <br>
@@ -43,18 +43,28 @@ Simple Interest, S.I. = $\dfrac{P \times R \times T}{100}$
4343

4444
**Q6:** Write a program to define a function to return factorial of the number passed in it (use recursion).
4545

46-
**Q6:** Write a program to define a function to return factorial of the number passed in it (without recursion).
46+
**Q7:** Write a program to define a function to return factorial of the number passed in it (without recursion).
4747

48-
**Q7:** Write a program to define a function that returns the permutation of ***n*** and ***r***.<br>
48+
**Q8:** Write a program to define a function that gets a year as input and print if it is a leap year or not.
49+
**Condition:** A year is leap if it is either divisible *4* or *400* and not *100*.
50+
51+
**Q9:** Write a program to define a function that returns the permutation of ***n*** and ***r***.<br>
4952
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$
5053

51-
**Q8:** Write a program to define a function that returns the caombinations of ***n*** and ***r***.<br>
52-
Permutation(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
54+
**Q10:** Write a program to define a function that returns the permutation of ***n*** and ***r***. Use recursion to compute the factorials.<br>
55+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$
5356

54-
**Q9:** Write a program to define a function that gets a year as input and print if it is a leap year or not.
55-
**Condition:** A year is leap if it is either divisible *4* or *400* and not *100*.
57+
**Q11:** Write a program to define a function that returns the permutation of ***n*** and ***r***.<br>
58+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!} = n(n-1)(n-2)...r ~\text{terms}$
59+
60+
**Q12:** Write a program to define a function that returns the combination of ***n*** and ***r***.<br>
61+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
5662

63+
**Q13:** Write a program to define a function that returns the combinations of ***n*** and ***r***. Use recursion to compute the factorials.<br>
64+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
5765

66+
**Q14:** Write a program to define a function that returns the combinations of ***n*** and ***r***.<br>
67+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!} = \dfrac{n(n-1)(n-2)...r ~\text{terms}}{1 \times 2 \times 3... r ~\text{(r terms)}} = \displaystyle \prod_{i ~= ~0}^{r ~-~1} \dfrac{n-i}{i+1}$
5868

5969
****
6070
**[Check Solution](Solution4.ipynb)**

‎Practice_code4.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Try working online at:
88

99
**Q2:** Write a program to create a function that gets sides of a rectangle and return its perimeter and area.
1010

11-
**Q3:** Write a program to create a function that gets a number ***n*** and a value and prints the value ***n*** times as output.
11+
**Q3:** Write a program to create a function that gets a number ***n*** and a value ***s***and prints the value ***n*** times as output.
1212
>Sample1:
1313
I/P:
1414
10 <br>
@@ -43,18 +43,28 @@ Simple Interest, S.I. = $\dfrac{P \times R \times T}{100}$
4343

4444
**Q6:** Write a program to define a function to return factorial of the number passed in it (use recursion).
4545

46-
**Q6:** Write a program to define a function to return factorial of the number passed in it (without recursion).
46+
**Q7:** Write a program to define a function to return factorial of the number passed in it (without recursion).
4747

48-
**Q7:** Write a program to define a function that returns the permutation of ***n*** and ***r***.<br>
48+
**Q8:** Write a program to define a function that gets a year as input and print if it is a leap year or not.
49+
**Condition:** A year is leap if it is either divisible *4* or *400* and not *100*.
50+
51+
**Q9:** Write a program to define a function that returns the permutation of ***n*** and ***r***.<br>
4952
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$
5053

51-
**Q8:** Write a program to define a function that returns the caombinations of ***n*** and ***r***.<br>
52-
Permutation(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
54+
**Q10:** Write a program to define a function that returns the permutation of ***n*** and ***r***. Use recursion to compute the factorials.<br>
55+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$
5356

54-
**Q9:** Write a program to define a function that gets a year as input and print if it is a leap year or not.
55-
**Condition:** A year is leap if it is either divisible *4* or *400* and not *100*.
57+
**Q11:** Write a program to define a function that returns the permutation of ***n*** and ***r***.<br>
58+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!} = n(n-1)(n-2)...r ~\text{terms}$
59+
60+
**Q12:** Write a program to define a function that returns the combination of ***n*** and ***r***.<br>
61+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
5662

63+
**Q13:** Write a program to define a function that returns the combinations of ***n*** and ***r***. Use recursion to compute the factorials.<br>
64+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
5765

66+
**Q14:** Write a program to define a function that returns the combinations of ***n*** and ***r***.<br>
67+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!} = \dfrac{n(n-1)(n-2)...r ~\text{terms}}{1 \times 2 \times 3... r ~\text{(r terms)}} = \displaystyle \prod_{i ~= ~0}^{r ~-~1} \dfrac{n-i}{i+1}$
5868

5969
****
6070
**[Check Solution](Solution4.ipynb)**
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<p>This Notebook Contains practice question for the note on <a href="Functions.ipynb">Functions</a>.</p>
2+
<p>Try working online at:<br />
3+
<a href="https://www.tutorialspoint.com/execute_python3_online.php">Coding Ground - Tutorials Point</a><br />
4+
<a href="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>
43+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$</p>
44+
<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>
45+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$</p>
46+
<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>
47+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!} = n(n-1)(n-2)...r ~\text{terms}$</p>
48+
<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>
49+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$</p>
50+
<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>
51+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$</p>
52+
<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>
53+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!} = \dfrac{n(n-1)(n-2)...r ~\text{terms}}{1 \times 2 \times 3... r ~\text{(r terms)}} = \displaystyle \prod_{i ~= ~0}^{r ~-~1} \dfrac{n-i}{i+1}$</p>
54+
<hr />
55+
<p><strong><a href="Solution4.ipynb">Check Solution</a></strong></p>

‎docs/Practice_code4.html

Lines changed: 103 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,103 @@
1-
<p>This Notebook Contains practice question for the note on <a href="Functions.html">Functions</a>.</p>
2-
<p>Try working online at:<br />
3-
<a href="https://www.tutorialspoint.com/execute_python3_online.php">Coding Ground - Tutorials Point</a><br />
4-
<a href="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>
41-
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$</p>
42-
<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>
43-
Permutation(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$</p>
44-
<p><strong>Q9:</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 />
45-
<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>
46-
<hr />
47-
<p><strong><a href="Solution4.html">Check Solution</a></strong></p>
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
8+
<title>Practice_code1</title>
9+
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
10+
11+
12+
<script>
13+
MathJax = {
14+
tex: { inlineMath: [['$', '$'], ['\\(', '\\)']] }
15+
};
16+
</script>
17+
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
18+
19+
</head>
20+
21+
<body>
22+
<p>This Notebook Contains practice question for the note on <a href="Functions.html">Functions</a>.</p>
23+
<p>Try working online at:<br />
24+
<a href="https://www.tutorialspoint.com/execute_python3_online.php">Coding Ground - Tutorials Point</a><br />
25+
<a href="https://www.onlinegdb.com/online_python_compiler">Online Compiler and Debugger</a>
26+
</p>
27+
<p><strong>Q1:</strong> Write a program to define a function <strong><em>multiply</em></strong> which get two
28+
parameters and returns the product of them.</p>
29+
<p><strong>Q2:</strong> Write a program to create a function that gets sides of a rectangle and return its perimeter
30+
and area.</p>
31+
<p><strong>Q3:</strong> Write a program to create a function that gets a number <strong><em>n</em></strong> and a
32+
value <strong><em>s</em></strong> and prints the value <strong><em>n</em></strong> times as output.</p>
33+
<blockquote>
34+
<p>Sample1:<br />
35+
I/P:<br />
36+
10 <br>
37+
Hello<br />
38+
O/p:<br />
39+
Hello<br />
40+
Hello<br />
41+
Hello<br />
42+
Hello<br />
43+
Hello<br />
44+
Hello<br />
45+
Hello<br />
46+
Hello<br />
47+
Hello<br />
48+
Hello </p>
49+
<p>Sample2:<br />
50+
I/P:<br />
51+
5 <br>
52+
1 <br>
53+
O/p:<br />
54+
1 <br>
55+
1 <br>
56+
1 <br>
57+
1<br />
58+
1 </p>
59+
</blockquote>
60+
<p><strong>Q4:</strong> Write a program to define a function to determine simple interest for given values of
61+
Principal, Rate p.a. and duration in years.<br />
62+
Simple Interest, S.I. = $\dfrac{P \times R \times T}{100}$</p>
63+
<p><strong>Q5:</strong> Write a program to get a number <strong><em>n</em></strong> and and print the prime numbers
64+
from 1 to <strong><em>n</em></strong>. Use function to check if a number is prime or not.</p>
65+
<p><strong>Q6:</strong> Write a program to define a function to return factorial of the number passed in it (use
66+
recursion).</p>
67+
<p><strong>Q7:</strong> Write a program to define a function to return factorial of the number passed in it (without
68+
recursion).</p>
69+
<p><strong>Q8:</strong> Write a program to define a function that gets a year as input and print if it is a leap
70+
year or not.<br />
71+
<strong>Condition:</strong> A year is leap if it is either divisible <em>4</em> or <em>400</em> and not
72+
<em>100</em>.
73+
</p>
74+
<p><strong>Q9:</strong> Write a program to define a function that returns the permutation of
75+
<strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
76+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$
77+
</p>
78+
<p><strong>Q10:</strong> Write a program to define a function that returns the permutation of
79+
<strong><em>n</em></strong> and <strong><em>r</em></strong>. Use recursion to compute the factorials.<br>
80+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!}$
81+
</p>
82+
<p><strong>Q11:</strong> Write a program to define a function that returns the permutation of
83+
<strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
84+
Permutation(n,r) = $^nP_r$ = $\dfrac{n!}{(n-r)!} = n(n-1)(n-2)...r ~\text{terms}$
85+
</p>
86+
<p><strong>Q12:</strong> Write a program to define a function that returns the combination of
87+
<strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
88+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
89+
</p>
90+
<p><strong>Q13:</strong> Write a program to define a function that returns the combinations of
91+
<strong><em>n</em></strong> and <strong><em>r</em></strong>. Use recursion to compute the factorials.<br>
92+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!}$
93+
</p>
94+
<p><strong>Q14:</strong> Write a program to define a function that returns the combinations of
95+
<strong><em>n</em></strong> and <strong><em>r</em></strong>.<br>
96+
Combination(n,r) = $^nC_r$ = $\dfrac{n!}{(n-r)!~r!} = \dfrac{n(n-1)(n-2)...r ~\text{terms}}{1 \times 2 \times
97+
3... r ~\text{(r terms)}} = \displaystyle \prod_{i ~= ~0}^{r ~-~1} \dfrac{n-i}{i+1}$
98+
</p>
99+
<hr />
100+
<p><strong><a href="Solution4.html">Check Solution</a></strong></p>
101+
</body>
102+
103+
</html>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /