You are on page 1of 2

1) message=input("enter welcome message:")

print(message)

output:

enter welcome message:

3) input first,Second and third number

num1=int(input("Enter First Number:"))

num2=int(input("Enter Second Number:"))

num3=int(input("Enter Third Number:"))

#Check if first number is lesser than rest of the two numbers.

if (num1< num2 and num1< num3):

print("The Smallest number is", num1)

#Check if Second number is greater than rest of the two numbers.

elif (num2 < num1 and num2< num3):

print ("The Smallest number is", num2)

else:

print ("The Smallest number is", num3)

#input first,Second and third number

num1=int(input("Enter First Number:"))

num2=int(input("Enter Second Number:"))

num3=int(input("Enter Third Number:"))

#Check if first number is greater than rest of the two numbers.

if (num1> num2 and num1> num3):

print("The Largest number is", num1)

#Check if Second number is greater than rest of the two numbers.

elif (num2 > num1 and num2> num3):

print ("The Largest number is", num2)

else:

print ("The Largest number is", num3)

4) a) stars = "******"

for x in range(6):
print(stars)

for y in range(1):

stars = stars.replace("*","",1)

b) def print_figure():

for i in range(5, 0, -1):

for count in range(i):

print('12345'[count], end='')

print()

print_figure()

You might also like