Computer Science, asked by harshitsharma172006, 5 months ago

Write a program

Show the output.​

Attachments:

Answers

Answered by allysia
0

Answer:

A python program goes like:

a)

\\\tt num=[] \\\tt sqs= []\\\tt for \ i \ in \ range(1,7+1): \\\tt {\qquad n= int (inpu ( "Enter  \ a \ number \ to \ be \ squared: \ " \ ))} \\\tt {\qquad num.append(n) } \\\tt{\qquad sq=n**3}\\\tt {\qquad sqs.append(sq)} \\\tt print()\\\tt for \ j \ in\ range\ (0,len(sqs))\ : \\\tt {\qquad for \k \ in\ range\ (0,len(num )):}\\\tt {\qquad {\qquad if \  j==k :}} \\\tt {\qquad   {\qquad { \qquad print("The \ cube \ of \ num[j] \ will\ be \ sqs[j]")}}} \\\tt

b)

def area_sq(n):

   return n*n

area_sq(20)

c)

def pro_dif(m,n):

   if m>n:

       print( "difference=", m-n, "\nproduct=", m*n)

   else:

       print( "difference=", n-m, "\nproduct=", m*n)

pro_dif(13,2)

d)

print("S. No", "\tName", "\tMarks")

print("1", "\tSia", "\t67")

print("2", "\tRita", "\t78")

print("3", "\tJay", "\t88")

Similar questions