Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

loop in coding

#Alan's Toolkit for conversions

def start() :
    print ("Welcome to the converter toolkit made by Alan.")
    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!")

start()
Comment

loops in coding

Do While X <= 5
 X = X + 5 
Loop
Comment

loops in coding

Do
 X = 5+2
Loop Until X > 5
Comment

loops in coding

Do
 Do_Something
Loop
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to collect input from a user in discord bot c# 
Csharp :: c# deeply related children 
Csharp :: query into complex object using dapper 
Csharp :: c# code for simplex method 
Csharp :: c# formula from string 
Csharp :: music file explorer c# 
Csharp :: f# list map function 
Csharp :: asp.net mvc select from many to many relationship 
Csharp :: C# dictionnaries 
Csharp :: Using a Views in .net and c# 
Csharp :: dispathcer in wpf stack overflow 
Csharp :: wpf string to byte array 
Csharp :: how to add serilog to your asp.net project 
Csharp :: edit pdf itextsharip 
Csharp :: add-users:430 Uncaught TypeError: $(...).validate is not a function 
Csharp :: C# Move Camera Over Terrain Using Touch Input In Unity 3D - Append To Camera 
Csharp :: set data annotation text in model c# 
Csharp :: go down a line in <summary dotnet 
Csharp :: kentico 13 api save attachment 
Csharp :: @using System,System.Core 
Csharp :: Make child unaffected by parents rotation Unity 
Csharp :: log4net.dll 
Csharp :: how to do minus with button c# 
Csharp :: JAJAAJAJAJ 
Csharp :: c sharp tenery operator with callin gmethods 
Csharp :: export xml 
Csharp :: If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. 
Csharp :: cqrs design pattern .net core 
Csharp :: viewresolver cyrillic 
Csharp :: Xamarin Forms Update Button Text Code 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =