## Python program to add one or more element in List

Program: #Append() is used for adding one element in List at the end of list. X=[9,18,27] X.append(36) print(X) output: [9, 18, 27, 36]...

Search

Rajesh Singh

- Jun 20
- 1 min

Program: #Append() is used for adding one element in List at the end of list. X=[9,18,27] X.append(36) print(X) output: [9, 18, 27, 36]...

12 views0 comments

Rajesh Singh

- Jun 18
- 1 min

Program: n=[9,18,27,36,45,54,63] print("List=",n) i=int(input("Enter the position of elements to delete : ")) del n[i] print("List after...

5 views0 comments

Rajesh Singh

- Jun 16
- 1 min

Program: list=[(1,15,11), (4,7,1), (7,11,2),(10,10,18)] print("The list is: " +str(list)) res1=min(list)[0] res2=min(list)[1]...

16 views0 comments

Rajesh Singh

- Jun 16
- 1 min

Program: list=[(1,15,11), (4,7,1), (7,11,2),(10,10,18)] print("The list is: " +str(list)) res1=max(list)[0] res2=max(list)[1]...

8 views0 comments

Rajesh Singh

- Jun 16
- 1 min

Program: n=float(input("Enter value in kilometers: ")) a=n*.621371 print("The miles of given kilometers is %.2f" %a) Output: Enter value...

9 views0 comments

Rajesh Singh

- Jun 16
- 1 min

Program: n=float(input("Enter a number: ")) a=n**.5 print("The square roots of given number is ", a) Output: Enter a number: 16 The...

5 views0 comments

Rajesh Singh

- Apr 1, 2020
- 1 min

While loop is used to iterate over a block of code again and again until a given condition returns false. A program is executed...

14 views0 comments

Rajesh Singh

- Apr 1, 2020
- 2 min

for () loop is a counting loop and repeats its body for a pre-defined number of times. It is a very versatile statement and has many...

17 views0 comments

Rajesh Singh

- Apr 1, 2020
- 1 min

If statement is within another if statement then this is called nested of control statements. Example num = -100 if num > 0:...

7 views0 comments

Rajesh Singh

- Apr 1, 2020
- 1 min

We use the if..elif..else statement when we need to check multiple conditions. Syntax: if condition: statement1 elif condition_2:...

15 views0 comments

Rajesh Singh

- Apr 1, 2020
- 1 min

if statements is execute a certain block of Python code when a particular condition is true. Whenever If..else statements are execute...

9 views0 comments

Rajesh Singh

- Mar 31, 2020
- 1 min

There are two method for finding roots of quadratic equation: Program: First Method: import cmath a = float (input("Enter the value of a...

79 views0 comments

Rajesh Singh

- Mar 31, 2020
- 1 min

A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6...

1,319 views0 comments

Rajesh Singh

- Mar 29, 2020
- 1 min

A palindromic number is a number that remains the same when its digits are reversed. Like 121. Program: n=int(input("Enter number:")) a=n...

51 views0 comments

Rajesh Singh

- Mar 29, 2020
- 1 min

Armstrong number is a number that is equal to the sum of cubes of its digits. For example 0, 1, 153, 370, 371 and 407 are the Armstrong...

247 views0 comments

Rajesh Singh

- Mar 29, 2020
- 1 min

First method to find factorial number of given number: n = int(input("Enter a number: ")) fact = 1 if n < 0: print("Factorial does not...

37 views0 comments

Rajesh Singh

- Mar 29, 2020
- 1 min

Python Program to Print the Fibonacci sequence Using While Loop n = int(input("Enter the number for Fibonacci sequence : ")) a, b = 0, 1...

63 views0 comments

Rajesh Singh

- Mar 26, 2020
- 1 min

Python Program to Check input number is Prime Number Program: n = int(input("Enter any number: ")) if n > 1: for i in range(2, n): if n %...

59 views0 comments