Skip to content

Commit 8b7db53

Browse files
tejkiran7navins7
authored andcommitted
Tejkiran - 2nd Year CSE C 180501161 (#163)
* tejkiran: cs c 180501161 * Delete hello_world.py * Delete occurences.py * Rename Assignments2/attstud.py to Assignment 2/attstud.py
1 parent 4d8bec2 commit 8b7db53

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Assignment 2/attstud.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
lst=[]
2+
n=int(input("Enter the number of students :"))
3+
for i in range(n):
4+
name=input("Enter name")
5+
lst.append(name)
6+
print(lst)
7+
for i in lst:
8+
if i.endswith('P'):
9+
print(i.split("-")[0])
10+
if i.endswith('p'):
11+
print(i.split("-")[0])
12+
13+

Assignments2/occurences.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tstr=input("Enter the string")
2+
freq={}
3+
for i in tstr:
4+
if i in freq:
5+
freq[i] +=1
6+
else:
7+
freq[i] =1
8+
print("occurances\n"+str(freq))

Assignments2/thief.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
amount=int(input("Enter the amount robbed ny thief"))
2+
if amount<5000:
3+
print("Profit is Loss")
4+
elif amount==20000:
5+
print("Profit is Good")
6+
elif amount>5000:
7+
if amount<19999:
8+
print("Profit is Moderate")

0 commit comments

Comments
 (0)