nums = [10, 20, 30]
nums_bak = nums.copy()
nums[0] = 100
print(nums)
print(nums_bak)
nums = [10, 20, 30]
nums_bak = nums.copy()
nums[0] = 100
print(nums)
print(nums_bak)
eng_members = [“Taro”, “Jiro”, “Saburo”]
math_members = [“Jiro”, “Saburo”, “Shiro”]
eng_members = set(eng_members)
math_members = set(math_members)
print(eng_members – math_members)
print(math_members – eng_members)
members = {“Taro”, “Jiro”, “Saburo”}
frozen_members = frozenset(members)
frozen_members.add(“Goro”)
scores = {“math”: 62, “english”: 91, “physics”: 84}
for key, value in scores.items():
print(f”{key:8}{value:3}”)
scores = [62, 91, 84]
scores = {“math”: 62, “english”: 91, “physics”: 84}
popped_value = scores.pop(“english”)
print(scores)
print(popped_value)
birthday = [2011,11,27]
print(“-“.join([str(n) for n in birthday]))
scores = [10, 20, 30, 20, 40]
tokyo = (“JPY”, 36, 140)
name = “Taro Yamada”
replaced_string = name.replace(“Taro”, “Jiro”)
upper_string = name.upper()
print(replaced_string)
print(upper_string)
tokyo = (“JPY”, 36, 140)
currency, *_ = tokyo
print(currency)
tokyo = “JPY”, 36, 140
tokyo = list(tokyo)
tokyo[0] = “YEN”
tokyo = tuple(tokyo)
print(tokyo)
print(tokyo[0])
prices = [100, 200, 150, 200, 100]
prices_with_tax = [price * 1.1 for price in prices if price != 200]
print(prices_with_tax)