Page 1 of 1

1. Explain each line in details for the following programs: #Write a program to print individual elements in a two dimen

Posted: Thu May 05, 2022 1:37 pm
by answerhappygod
1 Explain Each Line In Details For The Following Programs Write A Program To Print Individual Elements In A Two Dimen 1
1 Explain Each Line In Details For The Following Programs Write A Program To Print Individual Elements In A Two Dimen 1 (54.96 KiB) Viewed 43 times
please explain in detail (python)
thankyou
1. Explain each line in details for the following programs: #Write a program to print individual elements in a two dimensional list (a list of lists) using for loop without using index data=[[6, 8, 1], [9, 5, 7]] for x in data: for y in x: print(y) #Write a program to convert the case of an alphabet character=input("Enter an alphabet ") if(ord(character)>=65 and ord(character)<=90): print(chr(ord(character)+32)) elif(ord(character)>=97 and ord(character)<=122): print(chr(ord(character)-32)) else: print("this is not an alphabet") #Write a program to find a number from a list data=[6, 8, 1, 9, 15, 7, 11, 22, 2, 10] number=22 status=0 for x in data: if x==number: status=1 break if status==0: else: print("Not Found") print("Found")