I had a dream.

Hey guys.

I had a dream.
My dream was to learn to program.

So, I set my new years resolution to "Learn Python and maybe more coding languages"

So, once that clock hit 12:00 I started my learning experience!

Before you troll and say "Ifshi! THT ISNT CDOING!"
I know it is just a few simple scripts. But it is a start. And I am proud of myself.

So, some of the things I've worked on.

Code:
# Calculates perimeter and Area of a rectangle or Triangle
print("Calculate information about a rectangle")
length = float(input("Length: "))
width = float(input("Width: "))
print("Area", length * width)
print("Perimeter", 2 * length + 2 * width)

Code:
# Celsius to Fahrenheit temoerature converter
temp = float(input("Celsius Temperature: "))
print("Fahrenheit temperature: ", (temp * 9) / 5 + 32)

Code:
# Fahrenheit to Celsius temperature converter
temp = float(input("Fahrenheit temperature: "))
print("Celsius temperature: ", (temp - 32.0) * 5.0 / 9.0)

I'm pretty damn satisfied for the 3rd day of the year of how far I've came.

I feel accomplished!

Wooooo!

Also made a github for the future programmer in me.
https://github.com/ifish12

Peace

~iFish

EDIT: No telline me about if/else or how to make my temperature stuff into one. I know I need to, but I will do that later.

EDIT2

Some other sill things I've coded that serve no purpose

Code:
print("Halt!")
user_input = input("Who the fuck is here? ")
print("You may pass, " + user_input)
user_input = input ("Why are you here? " + user_input)
print("Oh, I see. Don't get lost in the city of Townsville!. ")

Code:
# This program calculates rate and distance problems
print("Input a rate and a distance")
rate = float(input("Rate: "))
distance = float(input("Distance: "))
print("Time: ", (distance / rate))

Comments

Just wondering, what's harder to program in, Python or Visual Basic? How hard is it to convert from one to the other, for example how hard would it be to convert this into Python? (It's part of a Football (as in Soccer) database I created. The procedure is to delete a record from a file of footballers.)

Code:
If lblNumberOfRecord.Text > 1 Then

			txtPlayerName.Text = "DELETE"
			SaveRecord()

			Dim i As Integer
			Dim NumOfNewRecords As Integer

			TempFilePath = CurDir() & "\Temp.dat"
			FileOpen(2, TempFilePath, OpenMode.Random, , , Len(PlayerRecord))

			NumOfNewRecords = 1

			For i = 1 To lblNumberOfRecord.Text

				FileGet(1, PlayerRecord, i)

				If Trim&#40;PlayerRecord.Name&#41; <> &#34;DELETE&#34; Then

					FilePut&#40;2, PlayerRecord, NumOfNewRecords&#41;
					NumOfNewRecords = NumOfNewRecords + 1

				End If

			Next i

			FileClose&#40;1&#41;
			FileClose&#40;2&#41;

			Kill&#40;PlayerFilePath&#41;
			FileCopy&#40;TempFilePath, PlayerFilePath&#41;
			Kill&#40;TempFilePath&#41;

			FileOpen&#40;1, PlayerFilePath, OpenMode.Random, , , Len&#40;PlayerRecord&#41;&#41;

			lblRecordNumber.Text = 1
			lblNumberOfRecord.Text = lblNumberOfRecord.Text - 1

			ReadRecord&#40;&#41;
		Else
			DeleteFile&#40;&#41;
		End If
 

Blog entry information

Author
iFish
Views
455
Comments
42
Last update

More entries in Personal Blogs

More entries from iFish

Share this entry

General chit-chat
Help Users
    SylverReZ @ SylverReZ: @Xdqwerty, You do realise that just about any SD card formatted to FAT32 should work with the...