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

Python Assignment 1

Ha ha ha ha ha ha ha ha h na ho jaye gi to hisar se aage bhi nahi aa rha h k sath h na to hisar junction of you to hisar se hu ki photo hai kya hai vo kam se hi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Python Assignment 1

Ha ha ha ha ha ha ha ha h na ho jaye gi to hisar se aage bhi nahi aa rha h k sath h na to hisar junction of you to hisar se hu ki photo hai kya hai vo kam se hi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Assignment 1

Topic: Variables (Refer: https://www.youtube.com/watch?v=ORCuz7s5cCY )


1. Declare a first name variable and assign a value to it
2. Declare a last name variable and assign a value to it
3. Declare a full name variable and assign a value to it
4. Declare a country variable and assign a value to it
5. Declare a city variable and assign a value to it
6. Declare an age variable and assign a value to it
7. Declare a year variable and assign a value to it
8. Declare a variable is_married and assign a value to it
9. Declare a variable is_true and assign a value to it
10. Declare a variable is_light_on and assign a value to it
11. Declare multiple variables in one line
12. Declare your age as an integer variable
13. Declare your height as a float variable
14. Declare a variable that stores a complex number

Topic: Operators (Refer: https://www.youtube.com/watch?v=GEMZpw7ug-


k&list=PLBlnK6fEyqRjdKzSsGiBpr6fAxawT9WWb )
1. Write a program that prompts the user to enter the triangle's base and height and
calculate the triangle's area (area = 0.5 x b x h).
2. Write a program that prompts the user to enter sides a, b, and c of the triangle. Calculate
the perimeter of the triangle
3. Get the length and width of a rectangle from the user. Calculate its area (area = length
x width) and perimeter (perimeter = 2 x (length + width))
4. Get the radius of a circle from the user. Calculate the area (area = pi x r x r) and
circumference (c = 2 x pi x r) where pi = 3.14.
5. Get values of x and y from the user input. Calculate the slope, x-intercept, and y-
intercept of y = 2x -2

You might also like