This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.ArrayList; | |
| import java.util.Scanner; | |
| public class Prob2 { | |
| public static void main(String[] args) { | |
| // TODO Auto-generated method stub | |
| int result= 0; | |
| Scanner scanner = new Scanner(System.in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.ArrayList; | |
| import java.util.Scanner; | |
| public class Prob2 { | |
| public static void main(String[] args) { | |
| // TODO Auto-generated method stub | |
| int result= 0; | |
| Scanner scanner = new Scanner(System.in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.ArrayList; | |
| import java.util.Scanner; | |
| public class Prob2 { | |
| public static void main(String[] args) { | |
| // TODO Auto-generated method stub | |
| int result= 0; | |
| Scanner scanner = new Scanner(System.in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input_saat = int(input("saat : ")) | |
| input_dk = int(input("dakika : ")) | |
| var_ekle = int(input("ekle : ")) | |
| #instead of using constant numbers inside the code it is a good habit to declare a final constant and use it in the wole code. | |
| #if you didn't understand this just skip it it's not a big deal for now ;=) | |
| MIN_IN_HOUR = 60 | |
| HOUR_IN_DAY = 24 | |
| #that's the easiset step i'm sure you understand it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| agir_sidet = input("a, o, h : ") | |
| if (agir_sidet == "a" or agir_sidet("h")) : | |
| ..... | |
| ...... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| csvReader = csv.reader(open("weather_2012.csv")) | |
| weatherCsvList = list(csvReader) | |
| weatherList = [] | |
| weatherMeanDegree = [] | |
| print(weatherCsvList[1][1]) | |
| for i in range(1, len(weatherCsvList)): | |
| if (weatherCsvList[i][7] in weatherList): | |
| oldMeanDegree = weatherMeanDegree[weatherList.index(weatherCsvList[i][7])] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| csvReader = csv.reader(open("weather_2012.csv")) | |
| weatherCsvList = list(csvReader) | |
| weatherDic = {} | |
| weatherMeanDegree = [] | |
| for i in range(1, len(weatherCsvList)): | |
| if weatherDic.__contains__(weatherCsvList[i][7] in weatherDic): | |
| weatherDic[weatherCsvList[i][7]] = (weatherDic[weatherCsvList[i][7]] + float(weatherCsvList[i][1]))/2 | |
| else : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| num_int = int(input("Bir doğal sayi (bitirmek için negatif sayi) giriniz:")) | |
| old_nums = [] | |
| rep_of_nums = [0]* 10 | |
| while (num_int >= 0): | |
| if not (num_int in old_nums): | |
| old_nums.append(num_int) | |
| rep_of_nums[int(num_int%100/10)] += 1 | |
| num_int = int(input("Bir doğal sayi (bitirmek için negatif sayi) giriniz:")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import matplotlib.pyplot as plot | |
| csvReader = csv.reader(open("weather_2012.csv")) | |
| weatherCsvList = list(csvReader) | |
| weatherDic = {} | |
| weatherMeanDegree = [] | |
| for i in range(1, len(weatherCsvList)): | |
| if weatherCsvList[i][7] in weatherDic: | |
| weatherDic[weatherCsvList[i][7]].append(float(weatherCsvList[i][1])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| def retrieveData(file_name_str, list_of_nominees) : | |
| csvReader = csv.reader(open(file_name_str)) | |
| electtionResultsList = list(csvReader) | |
| calculatedVotes = [] | |
| for nomineeName in list_of_nominees: | |
| for i in range(len(electtionResultsList[0])): |