Tuple Indexing

Easy Tuples
Solve in Playground →

Problem Statement

Write a Python program to access and print the element at a given index from a tuple.

Input Format

Line 1: Space-separated tuple elements. Line 2: Integer index.

Output Format

Print the element at the specified index.

Constraints

Valid index within tuple bounds

Sample Input

apple banana cherry date
2

Sample Output

cherry

Explanation

Tuple elements can be accessed using zero-based indexing inside square brackets.

Starter Code

def get_element(tup, idx):
    # Write your code here
    pass

tup = tuple(input().split())
idx = int(input())
print(get_element(tup, idx))

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used