Python Forum
What am i doing wrong - math tool box
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What am i doing wrong - math tool box
#10
do indentation properly

ans=True
while ans:
    print("""
    1.Square
    2.Rectangle
    3.Triangle
    4.Circle
    5.Exit the program
    """)
    ans=input("What would you like to do?")
    ans = ans.strip()
    if ans=='1':
        print("""Square is selected.""")
        side = int (input("Now input side"))
        print ("Area is", side*side)
        print ("Circumference is",4*side)
    
you can do for other cases also
by defalultinput() function converts userinput into string.
Reply


Messages In This Thread
What am i doing wrong - math tool box - by TJOm - Apr-18-2018, 06:59 PM
RE: What am i doing wrong - math tool box - by TJOm - Apr-18-2018, 07:37 PM
RE: What am i doing wrong - math tool box - by TJOm - Apr-18-2018, 07:45 PM
RE: What am i doing wrong - math tool box - by TJOm - Apr-18-2018, 08:06 PM
RE: What am i doing wrong - math tool box - by vishalhule - Jun-24-2018, 04:29 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020