Question
Write the function Bubble() to sort the list using Bubble sort technique. The function will take the list as parameter.

Answer

Get the step-by-step solution for this question inside the Vidyadip app.

Get the answer in the app

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Write a python program using function to print the sum of first n natural numbers. 
Write algorithm for POP(Remove) operation in stack.
Granuda Consultants are setting up a secured network for their office campus at Faridabad for their day to day office and web based activities. They are planning to have connectivity between 3 buildings and the head office situated in Kolkata. Answer the questions (a) to (d) after going through the building positions in the campus and other details, which are given below:

Distances between various buildings:

Building “RAVI” to Building “JAMUNA” 120m
Building “RAVI” to Building “GANGA” 50m
Building “GANGA” to Building “JAMUNA” 65m
Faridabad Campus to Head Office 1460km

Number of computers:

Building “RAVI” 25
Building “JAMUNA” 150
Building “GANGA” 51
Head Office 10

(a) Suggest the most suitable place (i.e. block) to house the server of this organization. Also give a reason to justify your suggested location.

(b) Suggest a cable layout of connections between the buildings inside the campus.

(c) Suggest the placement of the following devices with justification:

(i) Switch

(ii) Repeater

(d) The organization is planning to provide a high speed link with its head office situated in KOLKATA using a wired connection. Which of the following cable will be most suitable for this job?

(i) Optical Fiber

(ii) Co-axial cable

(iii) Ethernet cable

Write a program to create the list and ask user whether you want to add new element if say yes then add the element and print the new list else print the entered list.
WAP to find the sum of first n terms of the following series:
$x-x^2+x^3+\ldots$
Aarti is new in python data-handling. Please help her to count the number of lines which begins with ‘W’ or ‘w’ in poem.txt.

(a) # Line 1 : To open file POEM.txt in read mode

(b) # Line 2 : To check first character of every line is ‘W’ or ‘w’.

(c) # Line 3 : To increase the value of count by 1.

(d) # Line 4 : To call the function count_poem.

Write a script to create a list of 10 random integers. Create two more lists –one containing even elements from the original list, and the other containing odd elements from the original list. Use append() method to create first list and concatenation operator to create the second. Then display all the three lists.

Write a python program using function to accept a list as parameter and return the sum of all the list elements.
Write a program that accepts a sentence and calculate the number of upper case letters and lower case letters.
Suppose the following input is supplied to the program:
Python Programming SKILLS
Then, the output should be:
UPPER CASE 8
LOWER CASE 15
WAP to generate n lines of the following pattern on the computer screen: 1
2 2
3 3 3
4 4 4 4