Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeMartinRince authored Nov 25, 2024
1 parent 2c1f196 commit 1562487
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Day-9/joe.m.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
AUTHOR : JOE MARTIN RINCE
DATE : 24-11-2024
"""

limit=int(input("Enter your limit: "))
i=0
L=[]
while i < limit:
ty = input("Enter data type (S for String / N for Number): ").upper()

if ty == "S":
element = input("Enter the string element: ")
L.append(element)
i += 1
elif ty == "N":
try:
element = int(input("Enter the number element: "))
L.append(element)
i += 1
except ValueError:
print("Invalid input! Please enter a number.")
else:
print("Invalid type! Please enter 'S' or 'N'.")

print("Final list ",L,)

0 comments on commit 1562487

Please sign in to comment.