SlideShare a Scribd company logo
9. 3D ANIMATION
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
from vpython import *
def show_curve():
curve(x=arange(100), y=arange(100)**0.5, color=color.red)
def show_sphere():
ball = sphere(pos=vector(1,2,1), radius=0.5)
def show_cone():
cone(textures=textures.stucco,axis=vector(-1,4,0),up=vector(1,2,2,))
def show_arrow():
arrow(pos=vector(-2,0,0),color=vector(1,0,1),axis=vector(1,2,2),up=vector(-1,5,2))
def show_rings():
ring(pos=vector(1, 1, 1), axis=vector(0, 1, 0), radius=0.5, thickness=0.1)
def show_cylinder():
rod= cylinder(pos=vector(0, 2, 1), axis=vector(5, 0, 0), radius=1)
Curve
Sphere
Cone
Arrow
Rings
Cylinder
9. 3D ANIMATION
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
def menu():
print('1. Curve')
print('2. Sphere')
print('3. Cone')
print('4. Arrow')
print('5. Rings')
print('6. Cylinder')
ch= 'y'
while(ch=='y'):
menu()
choice = int(input('Enter choice..'))
if(choice == 1):
show_curve()
elif(choice == 2):
show_sphere()
elif(choice == 3):
show_cone()
elif(choice == 4):
show_arrow()
elif(choice == 5):
show_rings()
elif(choice == 6):
show_cylinder()
else:
print('Wrong choice')
ch= input('Do you want to continue (y/n)...')
Print
Menu
Curve
Sphere
Cone
Arrow
Rings
Cylinder
else Print
10. PULSE Vs HEIGHT
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
import matplotlib.pyplot as plt
n=int(input('enter the number of people:'))
p=[]
h=[]
for i in range(n):
p_i=int(input(f"enter pulse rate of person{i+1}:"))
h_i=int(input(f"enter height no of person{i+1}:"))
p.append(p_i)
h.append(h_i)
plt.scatter(h,p)
plt.title("pulse rate vs height")
plt.xlabel("height(cm)")
plt.ylabel("pusle rate(bpm)")
plt.show()
if __name__=='__main__':
main()
Package & init
p, h Declared
Label & Value
11. MASS Vs TIME
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
import matplotlib.pyplot as plt
def calculate_mass(t):
return 60/(t+2)
time_values = [i*0.5 for i in range(21)]
mass_values = [calculate_mass(t) for t in time_values]
plt.plot(time_values, mass_values)
plt.title('Graph of t vs. m')
plt.xlabel('Time (hours)')
plt.ylabel('Mass (grams)')
plt.show()
Package & Calculation
Label & Values
12. PASSWORD
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
import re
p=input("Input your password:")
x=True
while x:
if(len(p)<6 or len(p)>12):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif not re.search("s",p):
break
else:
print("valid password")
x=False
break
if x:
print("Not a valid password")
Package & Print
if.. else Statement (User Authentication)
13. VELOCITY
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
import matplotlib.pyplot as plt
u = float(input("Enter the initial velocity: "))
a = float(input("Enter the acceleration: "))
time_values = [i*0.5 for i in range(21)
velocity_values = [u + a*t for t in time_values]
distance_values_time = [u*t + 0.5*a*t**2 for t in time_values]
velocity_squared_values = [(u + a*t)**2 for t in time_values]
distance_values_velocity = [(v**2 - u**2)/(2*a) for v in velocity_squared_values]
plt.plot(time_values, velocity_values)
plt.title('Velocity vs. Time')
plt.xlabel('Time (s)')
plt.ylabel('Velocity (m/s)')
plt.show()
Package & Print
Range
Calculation
Label
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
plt.plot(time_values, distance_values_time)
plt.title('Distance vs. Time')
plt.xlabel('Time (s)')
plt.ylabel('Distance (m)')
plt.show()
plt.plot(velocity_squared_values, distance_values_velocity)
plt.title('Distance vs. Velocity')
plt.xlabel('Velocity Squared (m^2/s^2)')
plt.ylabel('Distance (m)')
plt.show()
Label
Label
13. VELOCITY
14. ROBOT
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
import math
def compute_distance(movements):
x, y = 0, 0
for move in movements:
direction, steps = move.split()
steps = int(steps)
if direction == 'UP':
y += steps
elif direction == 'DOWN':
y -= steps
elif direction == 'LEFT':
x -= steps
elif direction == 'RIGHT':
x += steps
distance = math.sqrt(x**2 + y**2)
return round(distance)
# Take input from the user
moves = []
while True:
move = input("Enter a movement (or 'done' to finish): ")
if move == 'done':
break
moves.append(move)
# Compute and print the distance
distance = compute_distance(moves)
print("The distance from the original point is:", distance)
15. TUPLES
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
def get_info():
name, age, height = input().split(',')
return name.strip(), int(age.strip()), int(height.strip())
n = int(input("Enter the number of tuples: "))
tuples = []
for i in range(n):
tuple = get_info()
tuples.append(tuple)
sorted_tuples = sorted(tuples, key=lambda x: (x[0], x[1], x[2]))
print("Sorted Tuples:")
for tuple in sorted_tuples:
print(", ".join(str(i) for i in tuple))
15. TUPLES
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
def get_info():
name, age, height = input().split(',')
return name.strip(), int(age.strip()), int(height.strip())
n = int(input("Enter the number of tuples: "))
tuples = []
for i in range(n):
tuple = get_info()
tuples.append(tuple)
sorted_tuples = sorted(tuples, key=lambda x: (x[0], x[1], x[2]))
print("Sorted Tuples:")
for tuple in sorted_tuples:
print(", ".join(str(i) for i in tuple))
15. TUPLES
Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga.,
def get_info():
name, age, height = input().split(',')
return name.strip(), int(age.strip()), int(height.strip())
n = int(input("Enter the number of tuples: "))
tuples = []
for i in range(n):
tuple = get_info()
tuples.append(tuple)
sorted_tuples = sorted(tuples, key=lambda x: (x[0], x[1], x[2]))
print("Sorted Tuples:")
for tuple in sorted_tuples:
print(", ".join(str(i) for i in tuple))

More Related Content

Similar to Lab 3 Python Programming Lab 8-15 MKU.pdf

밑바닥부터 시작하는 의료 AI
밑바닥부터 시작하는 의료 AI밑바닥부터 시작하는 의료 AI
밑바닥부터 시작하는 의료 AI
NAVER Engineering
 
Assignment 5.2.pdf
Assignment 5.2.pdfAssignment 5.2.pdf
Assignment 5.2.pdf
dash41
 
8. Vectors data frames
8. Vectors data frames8. Vectors data frames
8. Vectors data frames
ExternalEvents
 
GROUP 3 PPT self learning activity pptx.
GROUP 3 PPT self learning activity pptx.GROUP 3 PPT self learning activity pptx.
GROUP 3 PPT self learning activity pptx.
AmolAher20
 
MATHS LAB MANUAL 22mats11.pdf
MATHS LAB MANUAL 22mats11.pdfMATHS LAB MANUAL 22mats11.pdf
MATHS LAB MANUAL 22mats11.pdf
ssuser8f6b1d1
 
Ch4
Ch4Ch4
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
Ahmed BESBES
 
matlab.docx
matlab.docxmatlab.docx
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring CanvasKevin Hoyt
 
Vectors in Two and Three.pptx
Vectors in Two and Three.pptxVectors in Two and Three.pptx
Vectors in Two and Three.pptx
gayashani2
 
Pre-Calculus - Vectors
Pre-Calculus - VectorsPre-Calculus - Vectors
Pre-Calculus - Vectors
Frances Coronel
 
Vectors data frames
Vectors data framesVectors data frames
Vectors data frames
FAO
 
Advanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part IIAdvanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part II
Dr. Volkan OBAN
 
13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic Programming13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic Programming
Neeldhara Misra
 
Beyond Scala Lens
Beyond Scala LensBeyond Scala Lens
Beyond Scala Lens
Julien Truffaut
 
circ.db.dbcircleserver(1).py#!usrlocalbinpython3im.docx
circ.db.dbcircleserver(1).py#!usrlocalbinpython3im.docxcirc.db.dbcircleserver(1).py#!usrlocalbinpython3im.docx
circ.db.dbcircleserver(1).py#!usrlocalbinpython3im.docx
christinemaritza
 
6. R data structures
6. R data structures6. R data structures
6. R data structures
ExternalEvents
 
Presentation on calculus
Presentation on calculusPresentation on calculus
Presentation on calculus
Shariful Haque Robin
 
engineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-ivengineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-ivKundan Kumar
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Rai University
 

Similar to Lab 3 Python Programming Lab 8-15 MKU.pdf (20)

밑바닥부터 시작하는 의료 AI
밑바닥부터 시작하는 의료 AI밑바닥부터 시작하는 의료 AI
밑바닥부터 시작하는 의료 AI
 
Assignment 5.2.pdf
Assignment 5.2.pdfAssignment 5.2.pdf
Assignment 5.2.pdf
 
8. Vectors data frames
8. Vectors data frames8. Vectors data frames
8. Vectors data frames
 
GROUP 3 PPT self learning activity pptx.
GROUP 3 PPT self learning activity pptx.GROUP 3 PPT self learning activity pptx.
GROUP 3 PPT self learning activity pptx.
 
MATHS LAB MANUAL 22mats11.pdf
MATHS LAB MANUAL 22mats11.pdfMATHS LAB MANUAL 22mats11.pdf
MATHS LAB MANUAL 22mats11.pdf
 
Ch4
Ch4Ch4
Ch4
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
 
matlab.docx
matlab.docxmatlab.docx
matlab.docx
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
Vectors in Two and Three.pptx
Vectors in Two and Three.pptxVectors in Two and Three.pptx
Vectors in Two and Three.pptx
 
Pre-Calculus - Vectors
Pre-Calculus - VectorsPre-Calculus - Vectors
Pre-Calculus - Vectors
 
Vectors data frames
Vectors data framesVectors data frames
Vectors data frames
 
Advanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part IIAdvanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part II
 
13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic Programming13 - 06 Feb - Dynamic Programming
13 - 06 Feb - Dynamic Programming
 
Beyond Scala Lens
Beyond Scala LensBeyond Scala Lens
Beyond Scala Lens
 
circ.db.dbcircleserver(1).py#!usrlocalbinpython3im.docx
circ.db.dbcircleserver(1).py#!usrlocalbinpython3im.docxcirc.db.dbcircleserver(1).py#!usrlocalbinpython3im.docx
circ.db.dbcircleserver(1).py#!usrlocalbinpython3im.docx
 
6. R data structures
6. R data structures6. R data structures
6. R data structures
 
Presentation on calculus
Presentation on calculusPresentation on calculus
Presentation on calculus
 
engineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-ivengineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-iv
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
 

More from CUO VEERANAN VEERANAN

Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)
CUO VEERANAN VEERANAN
 
Fourier Transforms are indispensable tool
Fourier Transforms are indispensable toolFourier Transforms are indispensable tool
Fourier Transforms are indispensable tool
CUO VEERANAN VEERANAN
 
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.pptENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
CUO VEERANAN VEERANAN
 
ADS_Unit I_Route Map 2023.pdf
ADS_Unit I_Route Map 2023.pdfADS_Unit I_Route Map 2023.pdf
ADS_Unit I_Route Map 2023.pdf
CUO VEERANAN VEERANAN
 
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULINGCS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CUO VEERANAN VEERANAN
 
Python Unit I MCQ.ppt
Python Unit I MCQ.pptPython Unit I MCQ.ppt
Python Unit I MCQ.ppt
CUO VEERANAN VEERANAN
 
GAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptGAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.ppt
CUO VEERANAN VEERANAN
 
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.pptGAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
CUO VEERANAN VEERANAN
 
Lab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdfLab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdf
CUO VEERANAN VEERANAN
 
MULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.pptMULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
CUO VEERANAN VEERANAN
 
Relational Algebra.ppt
Relational Algebra.pptRelational Algebra.ppt
Relational Algebra.ppt
CUO VEERANAN VEERANAN
 
DS Unit I to III MKU Questions.pdf
DS Unit I to III MKU Questions.pdfDS Unit I to III MKU Questions.pdf
DS Unit I to III MKU Questions.pdf
CUO VEERANAN VEERANAN
 
Acharya Vinoba Bhave.ppt
Acharya Vinoba Bhave.pptAcharya Vinoba Bhave.ppt
Acharya Vinoba Bhave.ppt
CUO VEERANAN VEERANAN
 
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
CUO VEERANAN VEERANAN
 
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
CUO VEERANAN VEERANAN
 
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
CUO VEERANAN VEERANAN
 
1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of Computer1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of Computer
CUO VEERANAN VEERANAN
 
1.1.6 Characteristics of Computer
1.1.6 Characteristics of Computer1.1.6 Characteristics of Computer
1.1.6 Characteristics of Computer
CUO VEERANAN VEERANAN
 
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
CUO VEERANAN VEERANAN
 
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
CUO VEERANAN VEERANAN
 

More from CUO VEERANAN VEERANAN (20)

Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)
 
Fourier Transforms are indispensable tool
Fourier Transforms are indispensable toolFourier Transforms are indispensable tool
Fourier Transforms are indispensable tool
 
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.pptENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
 
ADS_Unit I_Route Map 2023.pdf
ADS_Unit I_Route Map 2023.pdfADS_Unit I_Route Map 2023.pdf
ADS_Unit I_Route Map 2023.pdf
 
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULINGCS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
 
Python Unit I MCQ.ppt
Python Unit I MCQ.pptPython Unit I MCQ.ppt
Python Unit I MCQ.ppt
 
GAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptGAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.ppt
 
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.pptGAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
 
Lab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdfLab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdf
 
MULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.pptMULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
 
Relational Algebra.ppt
Relational Algebra.pptRelational Algebra.ppt
Relational Algebra.ppt
 
DS Unit I to III MKU Questions.pdf
DS Unit I to III MKU Questions.pdfDS Unit I to III MKU Questions.pdf
DS Unit I to III MKU Questions.pdf
 
Acharya Vinoba Bhave.ppt
Acharya Vinoba Bhave.pptAcharya Vinoba Bhave.ppt
Acharya Vinoba Bhave.ppt
 
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
 
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
 
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
 
1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of Computer1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of Computer
 
1.1.6 Characteristics of Computer
1.1.6 Characteristics of Computer1.1.6 Characteristics of Computer
1.1.6 Characteristics of Computer
 
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
 
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 

Recently uploaded (20)

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 

Lab 3 Python Programming Lab 8-15 MKU.pdf

  • 1. 9. 3D ANIMATION Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., from vpython import * def show_curve(): curve(x=arange(100), y=arange(100)**0.5, color=color.red) def show_sphere(): ball = sphere(pos=vector(1,2,1), radius=0.5) def show_cone(): cone(textures=textures.stucco,axis=vector(-1,4,0),up=vector(1,2,2,)) def show_arrow(): arrow(pos=vector(-2,0,0),color=vector(1,0,1),axis=vector(1,2,2),up=vector(-1,5,2)) def show_rings(): ring(pos=vector(1, 1, 1), axis=vector(0, 1, 0), radius=0.5, thickness=0.1) def show_cylinder(): rod= cylinder(pos=vector(0, 2, 1), axis=vector(5, 0, 0), radius=1) Curve Sphere Cone Arrow Rings Cylinder
  • 2. 9. 3D ANIMATION Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., def menu(): print('1. Curve') print('2. Sphere') print('3. Cone') print('4. Arrow') print('5. Rings') print('6. Cylinder') ch= 'y' while(ch=='y'): menu() choice = int(input('Enter choice..')) if(choice == 1): show_curve() elif(choice == 2): show_sphere() elif(choice == 3): show_cone() elif(choice == 4): show_arrow() elif(choice == 5): show_rings() elif(choice == 6): show_cylinder() else: print('Wrong choice') ch= input('Do you want to continue (y/n)...') Print Menu Curve Sphere Cone Arrow Rings Cylinder else Print
  • 3. 10. PULSE Vs HEIGHT Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., import matplotlib.pyplot as plt n=int(input('enter the number of people:')) p=[] h=[] for i in range(n): p_i=int(input(f"enter pulse rate of person{i+1}:")) h_i=int(input(f"enter height no of person{i+1}:")) p.append(p_i) h.append(h_i) plt.scatter(h,p) plt.title("pulse rate vs height") plt.xlabel("height(cm)") plt.ylabel("pusle rate(bpm)") plt.show() if __name__=='__main__': main() Package & init p, h Declared Label & Value
  • 4. 11. MASS Vs TIME Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., import matplotlib.pyplot as plt def calculate_mass(t): return 60/(t+2) time_values = [i*0.5 for i in range(21)] mass_values = [calculate_mass(t) for t in time_values] plt.plot(time_values, mass_values) plt.title('Graph of t vs. m') plt.xlabel('Time (hours)') plt.ylabel('Mass (grams)') plt.show() Package & Calculation Label & Values
  • 5. 12. PASSWORD Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., import re p=input("Input your password:") x=True while x: if(len(p)<6 or len(p)>12): break elif not re.search("[a-z]",p): break elif not re.search("[0-9]",p): break elif not re.search("[A-Z]",p): break elif not re.search("[$#@]",p): break elif not re.search("s",p): break else: print("valid password") x=False break if x: print("Not a valid password") Package & Print if.. else Statement (User Authentication)
  • 6. 13. VELOCITY Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., import matplotlib.pyplot as plt u = float(input("Enter the initial velocity: ")) a = float(input("Enter the acceleration: ")) time_values = [i*0.5 for i in range(21) velocity_values = [u + a*t for t in time_values] distance_values_time = [u*t + 0.5*a*t**2 for t in time_values] velocity_squared_values = [(u + a*t)**2 for t in time_values] distance_values_velocity = [(v**2 - u**2)/(2*a) for v in velocity_squared_values] plt.plot(time_values, velocity_values) plt.title('Velocity vs. Time') plt.xlabel('Time (s)') plt.ylabel('Velocity (m/s)') plt.show() Package & Print Range Calculation Label
  • 7. Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., plt.plot(time_values, distance_values_time) plt.title('Distance vs. Time') plt.xlabel('Time (s)') plt.ylabel('Distance (m)') plt.show() plt.plot(velocity_squared_values, distance_values_velocity) plt.title('Distance vs. Velocity') plt.xlabel('Velocity Squared (m^2/s^2)') plt.ylabel('Distance (m)') plt.show() Label Label 13. VELOCITY
  • 8. 14. ROBOT Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., import math def compute_distance(movements): x, y = 0, 0 for move in movements: direction, steps = move.split() steps = int(steps) if direction == 'UP': y += steps elif direction == 'DOWN': y -= steps elif direction == 'LEFT': x -= steps elif direction == 'RIGHT': x += steps distance = math.sqrt(x**2 + y**2) return round(distance) # Take input from the user moves = [] while True: move = input("Enter a movement (or 'done' to finish): ") if move == 'done': break moves.append(move) # Compute and print the distance distance = compute_distance(moves) print("The distance from the original point is:", distance)
  • 9. 15. TUPLES Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., def get_info(): name, age, height = input().split(',') return name.strip(), int(age.strip()), int(height.strip()) n = int(input("Enter the number of tuples: ")) tuples = [] for i in range(n): tuple = get_info() tuples.append(tuple) sorted_tuples = sorted(tuples, key=lambda x: (x[0], x[1], x[2])) print("Sorted Tuples:") for tuple in sorted_tuples: print(", ".join(str(i) for i in tuple))
  • 10. 15. TUPLES Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., def get_info(): name, age, height = input().split(',') return name.strip(), int(age.strip()), int(height.strip()) n = int(input("Enter the number of tuples: ")) tuples = [] for i in range(n): tuple = get_info() tuples.append(tuple) sorted_tuples = sorted(tuples, key=lambda x: (x[0], x[1], x[2])) print("Sorted Tuples:") for tuple in sorted_tuples: print(", ".join(str(i) for i in tuple))
  • 11. 15. TUPLES Mr. V. VEERANAN, M.Sc. Computer Science., Dip.in.Yoga., def get_info(): name, age, height = input().split(',') return name.strip(), int(age.strip()), int(height.strip()) n = int(input("Enter the number of tuples: ")) tuples = [] for i in range(n): tuple = get_info() tuples.append(tuple) sorted_tuples = sorted(tuples, key=lambda x: (x[0], x[1], x[2])) print("Sorted Tuples:") for tuple in sorted_tuples: print(", ".join(str(i) for i in tuple))