FTDS-assignment-bay / p0-all-ngc-Radenaz

ftds-038-rmt-p0-all-ngc-template-ngc-1 created by GitHub Classroom
0 stars 0 forks source link

Open in Visual Studio Code

Non Graded Challenge: Python Syntax, Variables, and Data Type

This repository contains solutions for the Non Graded Challenge in FTDS Phase 0 - Week 1. The assignment evaluates fundamental concepts of Python syntax, variables, and data types.

Objectives

Tasks Overview

Task 1: Unique Customer IDs

Given a list of customer IDs representing transactions over a day, find how many unique customer IDs are present.

Input:

customer_id = ['B818', 'A461', 'A092', 'A082', 'B341', 'A005', 
               'A092', 'A461', 'B219', 'B904', 'A901', 'A083', 
               'B904', 'A092', 'B341', 'B821', 'B341', 'B821', 
               'B904', 'B818', 'A901', 'A083', 'B818', 'A082', 
               'B219', 'B219', 'A083', 'A901', 'A082', 'B341', 
               'B341', 'A083', 'A082', 'B219', 'B439', 'A461', 
               'A005', 'A901', 'B341', 'A082', 'A083', 'A461', 
               'A083', 'A901', 'A461', 'A083', 'A082', 'A083', 
               'B341', 'A901', 'A082', 'A461', 'B219', 'A083', 
               'B818', 'B821', 'A092', 'B341', 'A461', 'A092', 
               'A083', 'B821', 'A092']

Expected Output:

Number of unique customer IDs.

Task 2: List Indexing

Given a list of integers, use indexing to extract specific elements or sublists.

Input:

data = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]

Expected Outputs:

  1. Retrieve 16
  2. Retrieve [36, 49, 64, 81]
  3. Retrieve [100, 81, 64, 49, 36, 25, 16, 9, 4, 1]

Task 3: Dictionary Operations

Perform operations on a dictionary of provinces.

Input:

provinsi = {
    'Nanggroe Aceh Darussalam': 'Aceh',
    'Sumatera Selatan': 'Palembang',
    'Kalimantan Barat': 'Pontianak',
    'Jawa Timur': 'Madiun',
    'Sulawesi Selatan': 'Makassar',
    'Maluku': 'Ambon'
}

Expected Outputs:

  1. Retrieve the list of dictionary keys.
  2. Update the value of 'Jawa Timur' from 'Madiun' to 'Surabaya'.

Submission