-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment1.py
More file actions
31 lines (23 loc) · 772 Bytes
/
Assignment1.py
File metadata and controls
31 lines (23 loc) · 772 Bytes
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
# Assignment 1
#python basic concept
#Task perform basic mathematical operation
# 2.Mathematical operation
def addition(a,b):
return a+b
def subtraction(a,b):
return a-b
def multiplication(a,b):
return a*b
def division(a,b):
return a/b
#1.Input from the user
a = int(input("Enter the first number:"))
b = int(input("Enter the second number:"))
print(f"The result \n Addition:{addition(a,b)}\n Subtraction:{subtraction(a,b)}\n Multiplication:{multiplication(a,b)}\n Division:{division(a,b)}")
#Task 2
#personalized greeting
#input from user
first_name = str(input("Enter your first name:"))
last_name = str(input("Enter your second name:"))
#Result as mentioned in the Assignment
print(f"Hello,'{first_name+last_name}',! Welcome to python program")