From dc4f8777d826f1d472d32e7dfac94b4159024cd2 Mon Sep 17 00:00:00 2001 From: rraj22 <121498922+rraj22@users.noreply.github.com> Date: Fri, 24 Mar 2023 23:37:26 +0530 Subject: [PATCH 1/2] Create 220889_Rishav Raj --- 220889_Rishav Raj | 1 + 1 file changed, 1 insertion(+) create mode 100644 220889_Rishav Raj diff --git a/220889_Rishav Raj b/220889_Rishav Raj new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/220889_Rishav Raj @@ -0,0 +1 @@ + From 62c2d096886d5b8595ba84fd10fdd965b16f3617 Mon Sep 17 00:00:00 2001 From: rraj22 Date: Sun, 9 Apr 2023 19:34:25 +0530 Subject: [PATCH 2/2] submitting assignment 1 and 2 --- 220889_Rishav Raj | 1 - 220889_Rishav Raj/Assignment_1/first.py | 17 ++++++++ .../Assignment_2/ppoc assignment 2.py | 39 +++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) delete mode 100644 220889_Rishav Raj create mode 100644 220889_Rishav Raj/Assignment_1/first.py create mode 100644 220889_Rishav Raj/Assignment_2/ppoc assignment 2.py diff --git a/220889_Rishav Raj b/220889_Rishav Raj deleted file mode 100644 index 8b13789..0000000 --- a/220889_Rishav Raj +++ /dev/null @@ -1 +0,0 @@ - diff --git a/220889_Rishav Raj/Assignment_1/first.py b/220889_Rishav Raj/Assignment_1/first.py new file mode 100644 index 0000000..f16d9c2 --- /dev/null +++ b/220889_Rishav Raj/Assignment_1/first.py @@ -0,0 +1,17 @@ +#Write the code to get your rollno and name using arguments +def fun(rollno,name): + print(rollno, name) +fun(rollno="220889 ",name="RISHAV RAJ") + +#Give an example of calling a function +def calling(a,b): + print("First Name= ",a," Last Name= ",b) +calling(a="Rishav",b="Raj") + +#Write a python code to calculate the sum of first 10 integers using loop +sum=0 +for c in range(0,10): + sum+=c +print(sum) + + diff --git a/220889_Rishav Raj/Assignment_2/ppoc assignment 2.py b/220889_Rishav Raj/Assignment_2/ppoc assignment 2.py new file mode 100644 index 0000000..d1981a1 --- /dev/null +++ b/220889_Rishav Raj/Assignment_2/ppoc assignment 2.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +features = ['A', 'B', 'C'] +values = [2, 3, 4] +colors = ['red', 'blue', 'green'] +plt.bar(features, values, color=colors) +plt.title('Bar Graph') +plt.xlabel('Variables') +plt.ylabel('Values') +plt.show() + +import matplotlib.pyplot as plt +features = ['A', 'B', 'C', 'D'] +values = [10, 20, 15, 5] +plt.bar(features, values) +plt.title('Example Bar Graph') +plt.xlabel('Variables') +plt.ylabel('Values') +plt.show() + +import matplotlib.pyplot as plt +x_values = [1, 2, 3, 4, 5] +y_values = [2, 3, 5, 8, 9] +plt.scatter(x_values, y_values, color='red') +for i in range(len(x_values)-1): + plt.plot([x_values[i], x_values[i+1]], [y_values[i], y_values[i+1]], color='blue') +plt.title('Scattered Points with Lines') +plt.xlabel('X-axis') +plt.ylabel('Y-axis') +plt.show() + +import numpy as np +arr = np.array([1, 2, 5, 3]) +addition = arr + 2 +subtraction = arr - 1 +multiplication = arr * 3 +print('Original array:', arr) +print('Array after addition:', addition) +print('Array after subtraction:', subtraction) +print('Array after multiplication:', multiplication)