-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday_01Basics.py
More file actions
81 lines (53 loc) · 1.52 KB
/
Copy pathday_01Basics.py
File metadata and controls
81 lines (53 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#--------------------------------------
#Day1 Python Basic Programs
#--------------------------------------
#1.Print Statement
print("I'm Akalya,Just started my python journey!")
print("--------------------------------")
#2.Take input and print its type
value=input("Enter:")
print("Value=",value)
print("Type=",type(value))
print("--------------------------------")
#3.Swap Two numbers(with and without temp)
#without temp
a=int(input("Enter a:"))
b=int(input("Enter b:"))
print("The values of a and b before Swapping: a=",a,"b=",b)
a,b=b,a
print("The values of a and b after Swapping:a=",a,"b=",b)
#with temp
a=int(input("Enter a:"))
b=int(input("Enter b:"))
print("Before Swapping:")
print("a=",a)
print("b=",b)
temp=a
a=b
b=temp
print("After Swapping:"\n a=",a,"\n b=",b)
print("--------------------------------")
#4.Simple Calculator
a=int(input("Enter a:"))
b=int(input("Enter b:"))
print("This is a simple calculator with basic operations. \nBasic Operations like,")
print("\na. Add"
"\nb.Subtraction"
"\nc.Multiplication"
"\nd.Division")
print("sum=",a+b)
print("difference=",a-b)
print("product=",a*b)
print("quotient=",a//b)
print("Successfully executed!!")
print("--------------------------------")
#5. Area of a Circle
r=float(input("Enter value:"))
area=3.14159*r*r
print("Area of the circle is",area)
print("-------------------------------")
#6. Temperature Conversions
#------Celsius to Fahrenheit---------
temp=float(input("Enter Temperature Value:"))
res=(temp*9/5)+32
print("Celsius to Fahrenheit=",res,"°F")