Navbar menu

For loop - Python programs

Display sum of 1 to 10 number by using for loop
 
Code Snippet:



Display sum of 1 to 10 number by using for loop
Display sum 1 to 10 number by using for loop
Output:
Display sum of 1 to 10 number by using for loop
Output - display sum 1 to 10 number

Program to search a value in a list
 

Python Program to search a value in a list using for loop
Search value in a list using for loop
Output:

Python Program to search a value in a list using for loop
Output - search value in a list
Method 2: 
  • We can code this logic using simple if-else conditions also.
Python Program to search a value in a list using if-else
Search value in a list using if-else

No comments:

Post a Comment