У нас вы можете посмотреть бесплатно Write a program that depending upon user's choice either pushes or pops an element in a stack. или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Write a program that depending upon user's choice either pushes or pops an element in a stack . Website Link :- https://www.pathwalla.com/2020/07/wri... Data Structure : Stacks and Queues || Q 1 || Type C || Sumita Arora || Class 12 || Computer science • Data Structure : Stacks and Queues || Clas... Answer = stack = [ ] while True : com = input("Enter ( Push or Pop ) : ") if com == "push" or com == "Push" : num = int(input("Enter a number : ")) stack.append(num) elif len(stack) == 0 : print("Underflow") elif com == "pop" or com == "Pop" : stack.pop() yes = input ("Enter ( Yes or no ) : ") if yes == "No" or yes == "no": print("Thank you !!!!") break Output :- Enter ( Push or Pop ) : push Enter a number : 5 Enter ( Yes or no ) : yes Enter ( Push or Pop ) : push Enter a number : 6 Enter ( Yes or no ) : yes Enter ( Push or Pop ) : push Enter a number : 3 Enter ( Yes or no ) : yes Enter ( Push or Pop ) : pop Enter ( Yes or no ) : yes Enter ( Push or Pop ) : push Enter a number : 1 Enter ( Yes or no ) : no Thank you !!!! [5, 6, 1] data structures class 12 data structures class 12 python data structures class 12 isc