if 5 > 2: print("Hello, World!")
a = 18 b = 3.14 c = "Hello, World!" d = True e = [1, 2, 3, 4, 5] f = (1, 2, 3, 4, 5) g = {"key1": "value1", "key2": "value2"} print(type(a)) #print(type(b)) # print(type(c)) # print(type(d)) # print(type(e)) # print(type(f)) # print(type(g)) #
def add_numbers(a, b): return a + b result = add_numbers(2, 3) print(result) # 5
class Person: def __init__(self, name, age): self.name = name self.age = age def say_hello(self): print("Hello, my name is", self.name, "and I am", self.age, "years old.") p = Person("John", 30) p.say_hello() # Hello, my name is John and I am 30 years old.
标签: css