nums = [3, 4, 9, 5]

# Iterate over nums
for num in nums:
        # Check if num is even
        if num % 2 == 0:
                # Print out num
                print(num)
将给定代码修改为打印列表中的最大数字。
nums = [3, 4, 9, 5]

# Assign largest_num to -infinity
largest_num = -float('inf')

# Iterate over nums
for num in nums:
    # Check if num is larger than largest_num
    if num > largest_num:
        # Assign num to largest_num
        largest_num = num

# Print out largest_num
print(largest_num)