Floor 4 - Computer Room
Santa Rosa de Lima English Secondary School
聖羅撒英文中學
Colégio de Santa Rosa de Lima - Secção Inglesa
1
2
3
1
2
3
4
values = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
symbols = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
I = 1, IV = 4, V = 5, IX = 9, X = 10, XL = 40, L = 50, XC = 90, C = 100, CD = 400, D = 500, CM = 900, M = 1000.
1987 => MCMLXXXVII
1
2
3
4
values = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
symbols = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
I = 1, IV = 4, V = 5, IX = 9, X = 10, XL = 40, L = 50, XC = 90, C = 100, CD = 400, D = 500, CM = 900, M = 1000.
1987 => MCMLXXXVII
1
2
3
4
5
str1 = "listen"
str2 = "silent"
# Expected output:
# The strings are anagrams.
7
str1 = "elbow"
str2 = "below"
8
str1 = "dusty"
str2 = "study"
str1 = "night"
str2 = "thing"
6
str1 = "listen"
str2 = "silent"
str2 = list(str2)
# Removes the character at index 2 ('l') from the list: ['s', 'i', 'e', 'n', 't']
str2.pop(2)
print(str2)
1
2
3
4
5
str1 = "listen"
str2 = "silent"
# Expected output:
# The strings are anagrams.
7
str1 = "elbow"
str2 = "below"
8
str1 = "dusty"
str2 = "study"
str1 = "night"
str2 = "thing"
6
str1 = "listen"
str2 = "silent"
str2 = list(str2)
# Removes the character at index 2 ('l') from the list: ['s', 'i', 'e', 'n', 't']
str2.pop(2)
print(str2)
1
2
3
4
5
str1 = "listen"
str2 = "silent"
# Expected output:
# The strings are anagrams.
7
str1 = "elbow"
str2 = "below"
8
str1 = "dusty"
str2 = "study"
str1 = "night"
str2 = "thing"
6
str1 = "listen"
str2 = "silent"
str2 = list(str2)
# Removes the character at index 2 ('l') from the list: ['s', 'i', 'e', 'n', 't']
str2.pop(2)
print(str2)
1
2
3
4
5
str1 = "listen"
str2 = "silent"
# Expected output:
# The strings are anagrams.
7
str1 = "elbow"
str2 = "below"
8
str1 = "dusty"
str2 = "study"
str1 = "night"
str2 = "thing"
6
str1 = "listen"
str2 = "silent"
str2 = list(str2)
# Removes the character at index 2 ('l') from the list: ['s', 'i', 'e', 'n', 't']
str2.pop(2)
print(str2)
1
2
3
4
input_str = "((())())()"
# Output:
Balanced
5
input_str = "((())(()"
# Output:
Not Balanced
1
2
3
4
input_str = "((())())()"
# Output:
Balanced
5
input_str = "((())(()"
# Output:
Not Balanced