Home

Designed for school students & undergraduate entrance aspirants preparing for board exams, NEET, JEE and more.

JEE (Mains & Adv)NEET (UG)CBSE BoardISC BoardUP BoardCUET

Built for graduates & professionals targeting competitive exams — UPSC, CAT, GMAT, GRE, IELTS, banking & more.

GREGMATCATUPSCIBPSIELTSTOEFLSATACT

Core school & undergraduate subjects aligned with CBSE, ISC, UP Board, NEET and JEE syllabi.

PracticeMock TestsResources

Computer Science > Computational Thinking And Programming 2 > Data Structures

Success Rate: 0%
Single Question

A stack named

KeyStack
contains records of some computer keyboards. Each record is represented as a list containing Make, Keys, Connectivity. The Make and Connectivity are strings, and Keys is an integer. For example, a record in the stack may be
("Hitech", 105, "USB")
.

Write the following user-defined functions in Python to perform the specified operations on

KeyStack
: (I)
push_key (KeyStack, new_key)
: This function takes the stack KeyStack and a new record new_key as arguments and pushes this new record onto the stack. (II)
pop_key (KeyStack)
: This function pops the topmost record from the stack and returns it. If the stack is already empty, the function should display the message "Underflow". (III)
isEmpty(KeyStack)
: This function checks whether the stack is empty. If the stack is empty, the function should return True, otherwise the function should return False.

Edvaya Target App Icon

Edvaya Target

Board & Competitive Exams Made Easy

Edvaya Target is built for students preparing for JEE (Main & Advanced), NEET UG, and Board Exams (CBSE, ISC & State Boards) — using a practice-first approach that actually works.

Get it on Google Play

Current Question

Attempts0/3
StatusNot Answered
Ready to Answer! 🚀

Community Stats

Active Learners30
Questions Attempted560
Community Success Rate71%

Track Your Progress

Sign up to save your practice progress, add favorites, and get personalized insights.

Quick Actions

We Value Your Privacy

Edvaya uses cookies to enhance your learning experience, analyze platform usage, and provide personalized content. You can customize your preferences or accept all cookies to continue.

By continuing, you agree to our Cookie Policy and Privacy Policy