From 8c4c179485b76e15d16e21e275a302a148e08d7e Mon Sep 17 00:00:00 2001 From: Mustafa Kemal Date: Fri, 24 Sep 2021 21:40:07 +0200 Subject: [PATCH 1/2] softskildersinde yapilanlar. --- Answers.py | 0 Answers2.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Answers.py create mode 100644 Answers2.py diff --git a/Answers.py b/Answers.py new file mode 100644 index 0000000..e69de29 diff --git a/Answers2.py b/Answers2.py new file mode 100644 index 0000000..e69de29 From 4ec3428026570f89d66228a96e44f020ddabf79c Mon Sep 17 00:00:00 2001 From: Mstfkmlbsbdk <79099896+Mstfkmlbsbdk@users.noreply.github.com> Date: Thu, 7 Oct 2021 00:09:29 +0200 Subject: [PATCH 2/2] Add files via upload --- Les_2.py | 98 +++++++++++++++++++++++++++++++++++++++++++++++ Week02_Hw_1.py | 73 +++++++++++++++++++++++++++++++++++ Week02_Hw_1lll.py | 36 +++++++++++++++++ 3 files changed, 207 insertions(+) create mode 100644 Les_2.py create mode 100644 Week02_Hw_1.py create mode 100644 Week02_Hw_1lll.py diff --git a/Les_2.py b/Les_2.py new file mode 100644 index 0000000..ade7af3 --- /dev/null +++ b/Les_2.py @@ -0,0 +1,98 @@ + + +#LISTS +''' + +a='ab cd' #string +b=('a','b','c','d') #tuple +c={'a','b','c','d'} #set +d={'a':1, 'b':2,'c':3,'d':4} #dictionary + +print(list(a)) +print(list(b)) +print(list(c)) +print(list(d)) + +''' +''' +x=[1,2] + +print(3*x) +print(x+x+x) + +''' +''' +my_list=[0,3,12,8,2] + +print(5 in my_list) +print(5 not in my_list) + +''' +''' +n_list=["Hello",[1,2,3]] +print(n_list[0][2]) + +''' +''' +lst=["D","F","1","c",",",""," "] +lst.sort() +print(lst) +print(sorted(lst)) +''' +''' +nums=[1,2,3] +vals=nums +del vals[1:2] +print(vals) +print(nums) + +''' +''' + +p_letters=[] + +for letter in 'pycoders': + p_letters.append(letter) +print(p_letters) + +s=[[i for i in range(3)] for j in range(5)] + +print(s) + +''' +''' +number_list=[] + +for x in range(20): + if x%2==0: + number_list.append(x) +print(number_list) + +''' +''' +number_list=[x for x in range(29) if x%2==0] +print(number_list) + +''' + +#TUPLES + +#SETS + +#DICTIONARY + +Dictionary={ + "cat" : "kat", + "dog" : "hond", + "horse": "paard" +} + +for key in Dictionary.keys(): + + print(key, "->", Dictionary[key]) + + +Dictionary['lion']='leeuw' +Dictionary.update('liom' 'leeuw') + +print(Dictionary) diff --git a/Week02_Hw_1.py b/Week02_Hw_1.py new file mode 100644 index 0000000..77af774 --- /dev/null +++ b/Week02_Hw_1.py @@ -0,0 +1,73 @@ + +##from ast import NameConstant + +Contact_Information={} +Name_List=[] +Number_List=[] + +def Name_Fon(): + while True: + Name = input("What is your name? ") + if Name.isalpha(): + + Name_List.append(Name) + return Name + + else: + print("Please use only letters, try again") + +def Number_Fon(): + + while True: + Number=input("What is your Number? ") + if Number.isnumeric(): + + if len(str(Number))==10: + Number_List.append(Number) + + x=input("does your friend another numbers Y/N : ") + x=x.lower() + + if x=='y': + Number=Number_Fon() + for i in Number_List: + + return Number_List.append(Number) + + else: + return Number + + else: + print("10 digits Please") + + else: + print("Please use only number, try again") + + + + +n = int(input("Enter how many names you want to enter: ")) + +for i in range(n): + + Name=Name_Fon() + + Number=Number_Fon() + #Number_List.append(Number) + Contact_Information[Name]=Number_List + + '''x=input("does your friend another numbers Y/N : ") + x=x.lower() + + if x=='y': + + Number_List.append(Number) + Number=Number_Fon() + + Number_List.append(Number) + Contact_Information[Name]=Number_List + else: + continue''' + + +print(Contact_Information) diff --git a/Week02_Hw_1lll.py b/Week02_Hw_1lll.py new file mode 100644 index 0000000..ffcb1db --- /dev/null +++ b/Week02_Hw_1lll.py @@ -0,0 +1,36 @@ +Contact_Information={} +Name_List=[] +Number_List=[] + +def Name_Fon(): + while True: + Name = input("What is your name? ") + if Name.isalpha(): + + Name_List.append(Name) + return Name + + else: + print("Please use only letters, try again") + +def Number_Fon(): + while True: + Number=input("What is your Number? ") + if Number.isnumeric(): + + if len(str(Number))==10: + Number_List.append(Number) + return Number + else: + print("10 digits Please") + + +n = int(input("Enter how many names you want to enter: ")) + +for i in range(n): + + key = Name_Fon() + value = Number_Fon() + Contact_Information[key] = value + +print(Contact_Information) \ No newline at end of file