Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

loop in coding 1.2

def start():
    print ("Welcome to the converter toolkit made by Alan.")

    while True:
        op = input ("Please input what operation you wish to perform. 1 for Fahrenheit to Celsius, 2 for meters to centimetres and 3 for megabytes to gigabytes")

        if op == "1":
            f1 = input ("Please enter your fahrenheit temperature: ")
            f1 = int(f1)

            a1 = (f1 - 32) / 1.8
            a1 = str(a1)

            print (a1+" celsius") 

        elif op == "2":
            m1 = input ("Please input your the amount of meters you wish to convert: ")
            m1 = int(m1)
            m2 = (m1 * 100)

            m2 = str(m2)
            print (m2+" m")

        if op == "3":
            mb1 = input ("Please input the amount of megabytes you want to convert")
            mb1 = int(mb1)
            mb2 = (mb1 / 1024)
            mb3 = (mb2 / 1024)

            mb3 = str(mb3)

            print (mb3+" GB")

        else:
            print ("Sorry, that was an invalid command!")
Comment

PREVIOUS NEXT
Code Example
Python :: double digest fasta files 
Python :: Update only values in python 
Python :: numpy array filter and count 
Python :: dadfa 
Python :: python with statement local variables 
Python :: sqlite3.operationalerror no such column version 
Python :: kali linux run python script anywhere 
Python :: df.iterrows write to column 
Python :: regex library with def (apply , lambda) 
Python :: make n copies of item in list 
Python :: sklearn mahalanobis distance 
Python :: django admin make column link 
Python :: clipping path image using python 
Python :: find low and high in string 
Python :: python data engineer interview questions 
Python :: Another example: using a colorbar to show bar height 
Python :: check if there is a certain number difference with python 
Python :: pycharm writing issue 
Python :: get question mark from a word + python 
Python :: get the mean of all not nan values 
Python :: crear ondas segun musica python 
Python :: response object has no code 
Python :: python resample time series 
Python :: if short for python 
Python :: start models 
Python :: Count total number of null, isna sum python 
Python :: filtrar en python/how to filter in python 
Python :: how do i add new items to a dictionary within a for loop python 
Python :: convert ui to py 
Python :: how to get the original start_url in scrapy 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =