Menu

[Solved]1 Write Python Program Take Set User Input Calculate Number Odd Number Set Set Contain Int Q37174117

1-Write a python program to take a set as user input andcalculate the number of odd number in the set.

*** Set with only contain integervalues.

Sample Input:

Set_1 = {1, 2, 3, 6, 8, 98, 17}

Sample Output:

Number of odd numbers in the set is:3

*** 1, 3, 17 are the odd numbers.

  1. Write a python program to take a set as user input andcalculate the number of palindromes in the set.

*** Set will have only strings. Butstring can be of either digits or letters. Like, “124421”, “hello”etc.

Sample Input:

Set_1 = {“madam”, “45654”, “343”,“hello”, “morning”}

Sample Output:

Number of palindromes in the set is3.

*** (“madam”, “45654”, “343” are thepalindromes)

*** A palindrome is a word, phrase,number, or other sequence of characters which reads the samebackward or forward.

Expert Answer


Answer to 1-Write a python program to take a set as user input and calculate the number of odd number in the set. *** Set with onl… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *