write a program to print N numbers and then print the second largest number
Answers
Answered by
2
n = int(input("enter n: "))
nums = [str(n) for n in range(1, n + 1)]
print("\n".join(nums))
print(f"second largest num: {nums[-2]}")
Answered by
1
n = int(input("enter n: "))
nums = [str(n) for n in range(1, n + 1)]
print("\n".join(nums))
print(f"second largest num: {nums[-2]}")
Similar questions