In a school sports event, students wearing ODD jersey numbers enter the ground first. After they finish, students wearing EVEN jersey numbers enter the ground.
Let's use Python to display the order.
Displaying Odd Jersey Numbers
odd_no=1
print(odd_no,end=" ")
odd_no=odd_no+2
print(odd_no,end=" ")
odd_no=odd_no+2
print(odd_no,end=" ")
odd_no=odd_no+2
print(odd_no,end=" ")
odd_no=odd_no+2
print(odd_no,end=" ")
odd_no=odd_no+2
odd_no=1
while odd_no<=10:
print(odd_no,end=" ")
odd_no=odd_no+2
output 1 3 5 7 9
even_no=2
print(even_no,end=" ")
even_no=even_no+2
print(even_no,end=" ")
even_no=even_no+2
print(even_no,end=" ")
even_no=even_no+2
print(even_no,end=" ")
even_no=even_no+2
print(even_no,end=" ")
even_no=even_no+2
even_no=2
while even_no<=10:
print(even_no,end=" ")
even_no=even_no+2
output 2 4 6 8 10
combined program
print("Odd Jersey Numbers:")
odd_no=1
while odd_no<=10:
print(odd_no,end=" ")
odd_no=odd_no+2
print("\nEven Jersey Number:")
eeven_no=2
while even_no<=10:
print(even_no,end=" ")
even_no=even_no+2
Output:
Odd Jersey Numbers:
1 3 5 7 9
Even Jersey Number:
2 4 6 8 10
Top comments (0)