pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

Atomic Base

UIFlow 1.0 Project

Map

Example

map function is a common built-in function or method in many programming languages. It is mainly used for iterable objects. Here is how to use map function

from m5stack import *
from m5ui import *
from uiflow import *

date = None

date = {'a':1,'b':2,'c':'3'}
print('a' in date.keys())
print(date['b'])
date['d'] = '4'
date['a'] = '11'
date.pop('b')
date.clear()

API

date['a'] = '11'
  • Set key-value pairs in a dictionary
print('a' in date.keys())
  • Check if a key exists
date['d'] = '4'
  • Add a key-value pair to a dictionary
date.pop('b')
  • Delete a specified key
print(date['b'])
  • Retrieve the value of a key
date.clear()
  • Clear the dictionary
date = {'a':1,'b':2,'c':'3'}
  • Establish key-value pairs
On This Page