0% found this document useful (0 votes)
2 views

python test

The document contains Python code snippets demonstrating various programming concepts including input handling, conditional statements, loops, and data structures like lists, tuples, sets, and dictionaries. It also includes examples of user authentication and basic arithmetic operations. Overall, it serves as a tutorial for beginners to understand fundamental programming constructs in Python.

Uploaded by

thein than zaw
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

python test

The document contains Python code snippets demonstrating various programming concepts including input handling, conditional statements, loops, and data structures like lists, tuples, sets, and dictionaries. It also includes examples of user authentication and basic arithmetic operations. Overall, it serves as a tutorial for beginners to understand fundamental programming constructs in Python.

Uploaded by

thein than zaw
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

# print("Hello Python")

#
# print("Lesson 2")
# print("Sum Tow Digit")
#
# first = int(input("Enter Your first number"))
# second = int(input("Enter Your second number"))
# print("Total is "+str(first+second))
# print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
#
# print("lesson 3")
#
#
# print("Cheak even or odd")
# number = int(input("Enter number to check even or odd"))
# if number%2==0:
# print("The number is even")
# else:
# print("The number is odd")
#
# print("Exam mark")
#
# mark = int(input("Enter Your Marks"))
# if mark >= 80:
# print("Grade A")
# elif mark >= 80:
# print("Grade B")
# elif mark >= 70:
# print("Grade C")
# elif mark >= 60:
# print("Grdae D")
# else:
# print("Grde F")
#
# print("Current Tempearture")
#
# temperature = int(input("Enter Temperature"))
# if temperature <= 0:
# print("Freeze Cold")
# elif temperature >= 26:
# print("The outside temperature is high")
# else:
# print("Temperatur is preasent")
#
# print("Login")
#
# admin ="Thein Than Zaw"
# admin_passward = "sanminhtike"
# user_name = input("Enter user name")
# passward = input("Enter passward ")
# if user_name == admin and passward == admin_passward:
# print("Login sucessful ")
# else:
# print("Invaild user name or passward")
# print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
#
# import math
#
# print("Lesson 4")
# # list
# print("list")
# my_list = [1,2,3,4,5]
# print(my_list[3])
# print(my_list[-1])
# print(my_list[2])
# print(my_list[-2])
# my_list[2]=10
# my_list.append(6)
# my_list.remove(4)
# print(my_list)
# # tuple
# print("Tuple")
# my_tuple = (1,2,3,4,5)
# print(my_tuple[0])
# print(my_tuple[-1])
# print(my_tuple[3])
# print(my_tuple[-3])
#
# # Set
# print("Set")
# set1 ={1,2,3}
# set2 ={3,4,5}
# print(set1.union(set2))
# print(set1.intersection(set2))
# print(set1.difference(set2))
# print(set2.difference(set1))
# # Dictionaries
# print("Distionaries")
# my_dict ={"name": "John","age": 25,"city":"New York"}
# print(my_dict["name"])
# print(my_dict["age"])
# my_dict["city"]= "San Franciso"
# my_dict["country"]="USA"
# print(my_dict)
# def calculation_area(radius):
# return math.pi*radius**2
# circule_radius = 5
# are = calculation_area(circule_radius)
# print(f"The area of circle with radius {circule_radius} is {are}")
# print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
# Lesson 5
fruits = ["Apple","Orange","Banana"]
for loop in fruits:
print(loop)
numbers = [10,9,8,7,6,5,4]
total = 0
for number in numbers:
total += number
print(total)

student_grade= [88,95,86,80,77,43]
for grade in student_grade:
if grade<80 :
print("Low grade dected . Stop futher prosseing")
break
else:
print("Graed",grade)
print("End of processing")

count =10
while count>0:
print(count)
count -=1
print("Go")

attemp = 0
maxi_attemp = 3
authantication = False
while attemp<maxi_attemp:
username = input("Enter user name")
passward = input("Enter passward")
if username == "Thein Than Zaw" and passward=="Sanminhtike":
authantication=True
break

else:
print("Invalid User Name Or passward")
attemp+=1

if authantication ==True:
print("Login Successful")
else:
print("Max Login attemted is reach Access deline")

You might also like