diff --git a/Assignment 2/180501052/attendanceStudents.py b/Assignment 2/180501052/attendanceStudents.py new file mode 100644 index 0000000..64df5da --- /dev/null +++ b/Assignment 2/180501052/attendanceStudents.py @@ -0,0 +1,11 @@ +l=[] +x=int(input("Enter no of student")) +print("Enter your string") +for i in range(0,x): + a=str(input()) + l.append(a) +print("The students present were:") +for j in l: + z="P" in j + if(z): + print(j[0:-2],end=" ") diff --git a/Assignment 2/180501052/occurances.py b/Assignment 2/180501052/occurances.py new file mode 100644 index 0000000..a87febf --- /dev/null +++ b/Assignment 2/180501052/occurances.py @@ -0,0 +1,11 @@ +x =str(input("Enter the String:")) +a = {} + +for i in x: + if i in a: + a[i] += 1 + else: + a[i] = 1 +print("Occurences") +for j,y in a.items(): + print(j,y) diff --git a/Assignment 2/180501052/robberThief.py b/Assignment 2/180501052/robberThief.py new file mode 100644 index 0000000..e88de58 --- /dev/null +++ b/Assignment 2/180501052/robberThief.py @@ -0,0 +1,7 @@ +x =int(input("Enter the amount robbed by the thief:")) +if x < 5000: + print("Loss") +if x > 19999: + print("Good") +if x>4999 and x<20000: + print("Moderate")