Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
3.Tutorial 3 -Variables.pdf
1. MIET MiET SCHOOL
of Engineering
Engineers are driving the future
Python Programming
Tutorial 3
Learn & Lead
Eng. Ruwan Dissanayake
B.Sc.Eng(Hons) Electrical & Electronic Engineer , AMIESL
Former Engineer Corporate Strategy Sri lanka Telecom PLC
Dip.in. Counselling Psychology, Dip.in. Stress Management
Dip.in Buddhist Counselling Psychology(SIBA),
Dip.in Interior Designing, Design in Electrical Installation(IESL)
Certified Motivation Personality & Leadership Trainer
Certified Energy Healing Therapist & Counselor
077 593 10 68 / 071 241 70 27
PRE -ENGINEERING COURSE 2021
2. MIET MiET SCHOOL
of Engineering
Engineers are driving the future
Tutorial 1-Individual -Python - Variables
1. Write a Python program to input the first and last name of a person and output the full
name.
2. WriteaPythonprogramtoinputtwovaluesandoutputtheadditionofthem.
First name: banu
Second name: dasanayake
banu dasanayake
Input:
Output:
First Number: 25
Second Number: 43
25+43 = 68
Input:
Output:
3. Write a Python script to request the user to enter his name and age and display the details
in the following format. Remember to use comments in your scripts and appropriate
inputandoutputstatements.
Enteryourdetails
-------------------
Firstname:Saman
Lastname:Dasanayaka
Age:25
Hi!IamSamanDasanayakaandIam25yearsold.
4. Write a Python program that will accept the base and height of a triangle and compute the
area.
AreaofaTraiagle
-------------------
Base:12
Hight:8
Area:103
3. MIET MiET SCHOOL
of Engineering
Engineers are driving the future
5. Write a Python program to compute the future value(maturity Value) of a specified
principalamount,rateofinterest,andanumberofyears.
Input: Amount = 10000,
interest = 3.5
years = 7
Output: Maturity Value : 12722.79
6.WriteaPythonprogramtocalculatebodymassindex.
Input your height in meters: 1.2
Input your weight in Kilogram: 65
Your body mass index is: xxx
Output:
Input:
7.WriteaPythonprogramtoswap twovariables.
a : 20
b: 65
a=65 , b=20
Output:
Input:
4. MIET MiET SCHOOL
of Engineering
Engineers are driving the future
8.WriteaPythonprogram toconverttemperaturefromFahrenheittoCelsius.
Temp.in Fahrenheit : 50
Temp.in Celsius : 10
Output:
Input:
9.WriteaPythonprogramtoconvertdegreetoradian.
Input:
Output:
Degree : 15
radians: 0.2619047619047619
10.WriteaPythonprogramtoconvertradiantodegree..
Input:
Output:
Radian : 52
Degree: 29.781818181818185
11.WriteaPythonprogramtocalculate volumeandsurfaceareaofacylinder
Input:
Output:
Height : 4
Radius : 6
Volume is : 452.57142857142856
Surface Area is : 377.1428571428571
12. Write a Python program to input the number of electricity units consumed in a building
andoutputthetotalbill.
Input:
Output:
No of Units : 100
Unit Price : 4
Total Bill = Rs 400
5. MIET MiET SCHOOL
of Engineering
Engineers are driving the future
Special notes
Ÿ Send your code & screenshots of the output as a
single pdf file and do not forget to save your
documentusing yourregistrationnumber.
Ÿ (your Reg.Nois96=> )
96.ME_96_YourName
Ÿ Please submit your assignment to
mietschoolofengineering@gmail.com
13. Write a Python program to compute the distance between the points (x1, y1) and (x2,
14.WriteaPythonprogramtocalculatemidpointsofaline.
15. Write a Python program that accepts an integer (n) and computes the value of
n+(nn)+(nnn)
Input:
Output:
n =5
Value= 615
16.Speedofasinkingobjectinafluidisgivenby
where Ps=density of the object, P =density of the
f
fluid, r =radius of the object, n=viscosity of the
fluid, g=gravitational acceleration and V=speed
t
of the object. Write a Python program to find the
speed of the object when the other units are
given.