Write a program in python to display the square of an element if it is an integer and
change the case if the element is a string. List contains both integers and strings.
If the List L is : [10, “FUN”, 40, “FEW”, 50, “FULL”]
The final list should be: [100, “fun”, 1600, “few”, 2500, “full”]
Answers
Answered by
1
Answer:
Nothing we can pyton is easy
Answered by
6
Here is your Program !
- def func ( input_list ) :
- if type ( i ) == 'int' : print ( i2 )
- if i.isupper ( ): print ( i.lower ( ) )
- else : print ( i.upper ( ) )
- else : print ( i ) input_list = input ( ) func ( input_list ) input_list = [ ]
Similar questions