Savitribai Phule Pune University T.Y.B.B.A.(C.A.) Python Practical Slip 22 Answers

    Write a Python program

Slip 22 A) Write a python class to accept a string and number n from user and display n repetition of strings by overloading * operator.

Answer :

Output :

 

Slip 22 B) Write a python script to implement bubble sort using list

Answer :

lst=[12,10,17,9,1]

cnt=len(lst)

for i in range(0,cnt-1):

    for j in range(0,cnt-1):

        if lst[j]>lst[j+1]:

            temp=lst[j]

            lst[j]=lst[j+1]

            lst[j+1]=temp

print(lst)

Output :

Savitribai Phule Pune University T.Y.B.B.A.(C.A.) Python Practical Slip 22 Answers Savitribai Phule Pune University T.Y.B.B.A.(C.A.) Python Practical Slip 22 Answers Reviewed by technical_saurabh on December 31, 2021 Rating: 5

No comments:

Powered by Blogger.