Skip to content

Instantly share code, notes, and snippets.

View kendhia's full-sized avatar
💭
Loading...

Dhia Kennouche kendhia

💭
Loading...
View GitHub Profile
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);
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);
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);
@kendhia
kendhia / gist:5e95f6c5d650ca0f01b0755f06d7e335
Last active October 13, 2016 14:02
python_is_very_easy_to_learn_:)
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
agir_sidet = input("a, o, h : ")
if (agir_sidet == "a" or agir_sidet("h")) :
.....
......
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])]
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 :
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:"))
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]))
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])):