Skip to content

Commit

Permalink
perf: optimize D101.py
Browse files Browse the repository at this point in the history
had to do this since i saw the horrifying code
  • Loading branch information
soopyc authored Nov 9, 2023
1 parent 067a2e2 commit d83815f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Python/Finished/D101.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
(numbers that start with 5, 6 or 9).
'''
a = input()
aw = a[:1]
aw = int(a[0])

if aw == '2':
print('Fixed')
elif aw == '3':
print('Fixed')
if aw == '5':
print('Mobile')
elif aw == '6':
print('Mobile')
elif aw == '9':
print('Mobile')
if aw in [2, 3]:
print("Fixed")
elif aw in [5, 6, 9]:
print("Mobile")
else:
raise Exception("unexpected value")

0 comments on commit d83815f

Please sign in to comment.