what is python for code example
Example 1: why use python
public class Main {
public static void main(String[] args) {
System.out.println("hello world");
}
}
print('hello world')
Example 2: what is python used for
Python is a multipurpose language. Here are a few examples:
- Building softwares
- Talking to embedded electroncis
- Webscrapping
- Building websites
- Data science
- Artificial intelligence training
- Much more.
It is an easy to learn, easy to read, open-source development language.
Example 3: for loop in python
for x in range(6):
print(x)
Example 4: how to use a for loop in python
a_list = [1,2,3,4,5]
for x in a_list:
print(x)
Example 5: python for loop
for item in ['mosh','john','sarah']:
print(item)