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

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...