all InfoSec news
lists in python hackerrank solution
May 12, 2023, 5:40 a.m. | NJ
DEV Community dev.to
For Explanation watch the video
code ::
if __name__ == '__main__':
N = int(input())
L = []
for i in range(N):
cmd = input().split()
if cmd[0]=='insert':
L.insert(int(cmd[1]),int(cmd[2]))
elif cmd[0]=='print':
print(L)
elif cmd[0]=='remove':
L.remove(int(cmd[1]))
elif cmd[0]=='append':
L.append(int(cmd[1]))
elif cmd[0]=='sort':
L.sort()
elif cmd[0]=='pop':
L.pop()
elif cmd[0]=='reverse':
L.reverse()
code hackerrank input list lists pop print python remove reverse solution sort video watch
More from dev.to / DEV Community
Jobs in InfoSec / Cybersecurity
Senior Security Officer
@ eSimplicity | Remote
Senior - Automated Cyber Attack Engineer
@ Deloitte | Madrid, España
Public Key Infrastructure (PKI) Senior Engineer
@ Sherwin-Williams | Cleveland, OH, United States
Consultant, Technology Consulting, Cyber Security - Privacy (Senior) (Multiple Positions) (1502793)
@ EY | Chicago, IL, US, 60606
Principal Associate, CSOC Analyst
@ Capital One | McLean, VA
Real Estate Portfolio & Corporate Security Lead
@ Lilium | Munich