Computer Science, asked by roshanikashyap8, 7 months ago

write a program to python to input a list of numbers from the users and print all the odd no. from the list​

Answers

Answered by realabhizz
0

Answer:

I forgot the answer sorry sorry

Answered by saumya6sjs
0

Answer:

21 45 93

Please mark as brainliest answer......

Explanation:

Python program to print odd numbers in a List

Given a list of numbers, write a Python program to print all odd numbers in given list.

Example:

Input: list1 = [2, 7, 5, 64, 14]

Output: [7, 5]

Input: list2 = [12, 14, 95, 3, 73]

Output: [95, 3, 73]

Using for loop : Iterate each element in the list using for loop and check if num % 2 != 0. If the condition satisfies, then only print the number.

# Python program to print odd Numbers in a List

# list of numbers

list1 = [10, 21, 4, 45, 66, 93]

# iterating each number in list

for num in list1:

# checking condition

if num % 2 != 0:

print(num, end = " "

Similar questions