0% found this document useful (0 votes)
14 views3 pages

Python Code Examples and Exercises

aaa

Uploaded by

mpumpkin255
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Python Code Examples and Exercises

aaa

Uploaded by

mpumpkin255
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ไฟล์ code ครับ

[Link]
g
# fruits = ["apple","banana"]
# [Link]("orange")
# [Link](1,"melon")
# [Link]("orange")

# for fruit in fruits :


# print(f"This is {fruit}.")

# i= 0

# while i < 3 :
# print(i)
# i = i+1

########## Dictionary in Moblie Robot #############

# graph = {
# 'A' : ['B','C'] ,
# 'B' : ['D','E'] ,
# 'C' : ['F'] ,
# 'D' : [] ,
# 'E' : [] ,
# 'F' : []
# }

# start = 'A'
# goal = 'C'
# frontire = [start]
# explored = set() # Use a set for unique (iqnore duplicate append)

# print(frontire , explored)

# while len(frontire) > 0:


# current = [Link]() # Remove and put into current varaible
# print(current)

# if current == goal :
# print("Goal reach")
# break

# for neighbor in graph[current]:


# [Link](neighbor)
#Assignment 1
age = 26
height = 5.9
name = "Thirachai Phasukpan"
student = True
print(age , height , name , student)

#Assignment 2
sentence = "Python programming is fun"
print([Link]())
print([Link]("fun","awesome"))
print([Link]())

#Assignment 3
colors = []
[Link]("red")
[Link]("green")
[Link]("blue")
print(colors)

#Assignment 4
animals = ["cat","dog","rabbit","bird"]
[Link]("rabbit")
print(animals)

#Assignmant 5
numbers = [1,2,4,5,6]
[Link](2,3)
print(numbers)
[Link](0,0)
print(numbers)

You might also like