You are on page 1of 3

ANSWER 2

day = int(input("Enter the day of your birth:-"))

month= input("Enter the month of your birth :-")

if month == 'December':

sign = 'Sagittarius' if (day < 22) else 'capricorn'

elif month == 'January':

sign = 'Capricorn' if (day < 20) else 'aquarius'

elif month == 'February':

sign = 'Aquarius' if (day < 19) else 'pisces'

elif month == 'March':

sign = 'Pisces' if (day < 21) else 'aries'

elif month == 'April':

sign = 'Aries' if (day < 20) else 'taurus'

elif month == 'May':

sign = 'Taurus' if (day < 21) else 'gemini'

elif month == 'June':

sign = 'Gemini' if (day < 21) else 'cancer'

elif month == 'July':

sign = 'Cancer' if (day < 23) else 'leo'

elif month == 'August':

sign = 'Leo' if (day < 23) else 'virgo'

elif month == 'September':

sign = 'Virgo' if (day < 23) else 'libra'

elif month == 'October':

sign = 'Libra' if (day < 23) else 'scorpio'

elif month == 'November':

sign = 'scorpio' if (day < 22) else 'sagittarius'

print("\n Your astrosign is:-"+sign)


Answer 3
no=int(input("Enter a number:"))

temp=0

if no>1:

for i in range(2,no):

if no%i==0:

temp+=1;

if temp==0:

print(no,"is a prime number")

else:

print(no,"is not a prime number")

Answer 4
value=[]

raw_input=input("Enter the binary values separated by commas:- ")

items=[x for x in raw_input.split(',')]

for p in items:

intp = int(p, 2)

if not intp%5:

value.append(p)

print(','.join(value))
Answer 1
opt=int(input("Choose an option:- \n 1 for Celsius to Fahrenheit conversion \n 2 for Fahrenheit to
Celsius conversion\n"))

if opt==1:

temp=float(input("Enter a temperature in celsius scale:-"))

conv=((9*temp)/5)+32

print("Corresponding temperature in fahrenheit scale is:-",conv)

elif opt==2:

temp=float(input("Enter a temperature in fahrenheit scale:-"))

conv=((temp-32)*5)/9

print("Corresponding temperature in celsius scale is:-",conv)

else:

print("Sorry. You have entered a wrong option")

Answer 5
no=int(input("Enter a number:-"))

for i in range(11):

x=no*i

print(no," X ",i," = ",x)

Answer 6
rng=int(input("Please enter range of sequence:- "))

for i in range(1,rng+1):

for j in range(0,i):

print(i,end="")

print("\n")

You might also like