GithubHelp home page GithubHelp logo

hello-world's Introduction

my personal conveter

print("Please enter name") user_name=input() print("Greetings "+user_name+" welcome to your personal unit conerter") print("Please choose which conversion you would like to perform:") conversion=("1.convert cm to inches\n" "2.convert height from feet and inches to cm\n" "3.convert cups to ml\n" "4.convert grams to ounces\n" "5.convert percentage into letter grade,") print(conversion) print("Choice:") Choice=int(input())

if Choice ==1:

print("convert cm to meters")
def cm_m(a):
    return a/100
print("meters = "+ str(cm_m(int(input("input in cm: ")))))

elif Choice==2:

    print("convert height from feet and inches to cm \n")
    feet = int(input("enter feet: "))
    inches = int(input("enter inches: "))
    def _height(feet=0,inches=0):
        inches_cm=inches*2.54
        feet_cm=feet*12*2.54
        return inches_cm + feet_cm
    print("height="+str(_height(feet, inches)))

elif Choice==3:

print("convert cups to ml")
def ml(b):
    return b*100
print("milliliters = "+ str(ml(int(input("input in cups: ")))))

elif Choice==4:

print("convert garms into ounces")
def ounces(c):
    return c/28.35
print("ounces = "+ str(ounces(float(input("input in grams: ")))))

elif Choice==5:

print("convert percentage into letter grade")

mark = int(input("Enter Marks: "))

def final_grade(x): if (x >= 80 and x <= 100): grade = 'A' elif (x >= 70 and x < 80): grade = 'B' elif (x >= 60 and x < 70): grade = 'C' elif (x >= 50 and x < 60): grade = 'D' elif (x >= 20 and x < 50): grade = 'E' elif (x >= 0 and x < 20): grade = 'F'

return grade

print('Grade: ' + final_grade(mark)); print('Goodbye')

hello-world's People

Contributors

shaheed-ai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.