From dfa8b2fb475e6db34e141af36ce273d5c4d12042 Mon Sep 17 00:00:00 2001 From: bartowen <153402996+bartowen@users.noreply.github.com> Date: Wed, 14 Aug 2024 01:39:49 +0000 Subject: [PATCH 1/3] Ejercicios --- .learn/resets/01-Console/app.py | 1 + .learn/resets/02-Declare-Variables/app.py | 1 + exercises/01-Console/app.py | 3 ++- exercises/02-Declare-Variables/app.py | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .learn/resets/01-Console/app.py create mode 100644 .learn/resets/02-Declare-Variables/app.py diff --git a/.learn/resets/01-Console/app.py b/.learn/resets/01-Console/app.py new file mode 100644 index 00000000..ff00ab34 --- /dev/null +++ b/.learn/resets/01-Console/app.py @@ -0,0 +1 @@ +# print "Hello World!" on the console \ No newline at end of file diff --git a/.learn/resets/02-Declare-Variables/app.py b/.learn/resets/02-Declare-Variables/app.py new file mode 100644 index 00000000..83e80593 --- /dev/null +++ b/.learn/resets/02-Declare-Variables/app.py @@ -0,0 +1 @@ +# ✅ ↓ your code here ↓ ✅ diff --git a/exercises/01-Console/app.py b/exercises/01-Console/app.py index ff00ab34..9677dbff 100644 --- a/exercises/01-Console/app.py +++ b/exercises/01-Console/app.py @@ -1 +1,2 @@ -# print "Hello World!" on the console \ No newline at end of file +# print "Hello World!" on the console +print('Hello World!') \ No newline at end of file diff --git a/exercises/02-Declare-Variables/app.py b/exercises/02-Declare-Variables/app.py index 83e80593..1f7b89a7 100644 --- a/exercises/02-Declare-Variables/app.py +++ b/exercises/02-Declare-Variables/app.py @@ -1 +1,3 @@ # ✅ ↓ your code here ↓ ✅ +name = "Yellow" +print(name) \ No newline at end of file From 08d4279245a248374f58777280246ddf3653c229 Mon Sep 17 00:00:00 2001 From: bartowen <153402996+bartowen@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:02:05 +0000 Subject: [PATCH 2/3] avance tarea --- .../03-Print-Variables-In-The-Console/app.py | 1 + .learn/resets/04-Multiply-Two-Values/app.py | 1 + .learn/resets/05-User-Inputed-Values/app.py | 4 +++ .learn/resets/06-String-Concatenation/app.py | 6 +++++ .learn/resets/07-Create-a-Basic-HTML/app.py | 13 ++++++++++ .learn/resets/08.1-Your-First-If/app.py | 3 +++ .../08.2-How-Much-The-Wedding-Costs/app.py | 12 +++++++++ .learn/resets/09-Random-Numbers/app.py | 8 ++++++ .../10-Calling-Your-First-Function/app.py | 6 +++++ .../10.1-Creating-Your-First-Function/app.py | 6 +++++ .learn/resets/11-Create-A-New-Function/app.py | 3 +++ .../resets/12-Rand-From-One-to-Twelve/app.py | 8 ++++++ .learn/resets/13-Your-First-Loop/app.py | 6 +++++ .learn/resets/14-Create-A-For-Loop/app.py | 5 ++++ .learn/resets/15-Looping-With-FizzBuzz/app.py | 5 ++++ .learn/resets/16-Random-Colors-Loop/app.py | 25 +++++++++++++++++++ .../03-Print-Variables-In-The-Console/app.py | 6 ++++- exercises/04-Multiply-Two-Values/app.py | 2 ++ exercises/05-User-Inputed-Values/app.py | 2 +- exercises/06-String-Concatenation/app.py | 3 ++- exercises/07-Create-a-Basic-HTML/app.py | 3 ++- exercises/08.1-Your-First-If/app.py | 6 +++++ .../08.2-How-Much-The-Wedding-Costs/app.py | 7 +++++- exercises/09-Random-Numbers/app.py | 2 +- .../10-Calling-Your-First-Function/app.py | 3 ++- .../10.1-Creating-Your-First-Function/app.py | 2 +- exercises/11-Create-A-New-Function/app.py | 4 +++ exercises/12-Rand-From-One-to-Twelve/app.py | 3 ++- exercises/13-Your-First-Loop/app.py | 2 +- exercises/14-Create-A-For-Loop/app.py | 4 ++- exercises/15-Looping-With-FizzBuzz/app.py | 9 +++++++ 31 files changed, 159 insertions(+), 11 deletions(-) create mode 100644 .learn/resets/03-Print-Variables-In-The-Console/app.py create mode 100644 .learn/resets/04-Multiply-Two-Values/app.py create mode 100644 .learn/resets/05-User-Inputed-Values/app.py create mode 100644 .learn/resets/06-String-Concatenation/app.py create mode 100644 .learn/resets/07-Create-a-Basic-HTML/app.py create mode 100644 .learn/resets/08.1-Your-First-If/app.py create mode 100644 .learn/resets/08.2-How-Much-The-Wedding-Costs/app.py create mode 100644 .learn/resets/09-Random-Numbers/app.py create mode 100644 .learn/resets/10-Calling-Your-First-Function/app.py create mode 100644 .learn/resets/10.1-Creating-Your-First-Function/app.py create mode 100644 .learn/resets/11-Create-A-New-Function/app.py create mode 100644 .learn/resets/12-Rand-From-One-to-Twelve/app.py create mode 100644 .learn/resets/13-Your-First-Loop/app.py create mode 100644 .learn/resets/14-Create-A-For-Loop/app.py create mode 100644 .learn/resets/15-Looping-With-FizzBuzz/app.py create mode 100644 .learn/resets/16-Random-Colors-Loop/app.py diff --git a/.learn/resets/03-Print-Variables-In-The-Console/app.py b/.learn/resets/03-Print-Variables-In-The-Console/app.py new file mode 100644 index 00000000..f62f6922 --- /dev/null +++ b/.learn/resets/03-Print-Variables-In-The-Console/app.py @@ -0,0 +1 @@ +# ✅ ↓ your code here ↓ ✅ \ No newline at end of file diff --git a/.learn/resets/04-Multiply-Two-Values/app.py b/.learn/resets/04-Multiply-Two-Values/app.py new file mode 100644 index 00000000..83e80593 --- /dev/null +++ b/.learn/resets/04-Multiply-Two-Values/app.py @@ -0,0 +1 @@ +# ✅ ↓ your code here ↓ ✅ diff --git a/.learn/resets/05-User-Inputed-Values/app.py b/.learn/resets/05-User-Inputed-Values/app.py new file mode 100644 index 00000000..b569ee62 --- /dev/null +++ b/.learn/resets/05-User-Inputed-Values/app.py @@ -0,0 +1,4 @@ +age = int(input('What is your age?\n')) +# ✅ ↓ CHANGE THE CODE BELOW TO ADD 10 TO AGE ↓ ✅ + +print("Your age is: "+str(age)) \ No newline at end of file diff --git a/.learn/resets/06-String-Concatenation/app.py b/.learn/resets/06-String-Concatenation/app.py new file mode 100644 index 00000000..97521fb2 --- /dev/null +++ b/.learn/resets/06-String-Concatenation/app.py @@ -0,0 +1,6 @@ +# ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅ + + +## Don't change anything below this line +the_new_string = my_var1 + ' ' + my_var2 +print(the_new_string) diff --git a/.learn/resets/07-Create-a-Basic-HTML/app.py b/.learn/resets/07-Create-a-Basic-HTML/app.py new file mode 100644 index 00000000..ab15ceb0 --- /dev/null +++ b/.learn/resets/07-Create-a-Basic-HTML/app.py @@ -0,0 +1,13 @@ +a = '' +b = '' +c = '' +d = '' +e = '' +f = '' +g = '' +h = '<body>' + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ + +# ✅ ↓ start coding below here ↓ ✅ + diff --git a/.learn/resets/08.1-Your-First-If/app.py b/.learn/resets/08.1-Your-First-If/app.py new file mode 100644 index 00000000..6928dd3f --- /dev/null +++ b/.learn/resets/08.1-Your-First-If/app.py @@ -0,0 +1,3 @@ +total = int(input('How much money do you have in your pocket\n')) + +# ✅ ↓ YOUR CODE HERE ↓ ✅ diff --git a/.learn/resets/08.2-How-Much-The-Wedding-Costs/app.py b/.learn/resets/08.2-How-Much-The-Wedding-Costs/app.py new file mode 100644 index 00000000..ad0a1008 --- /dev/null +++ b/.learn/resets/08.2-How-Much-The-Wedding-Costs/app.py @@ -0,0 +1,12 @@ +user_input = int(input('How many people are coming to your wedding?\n')) + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ + + +if user_input <= 50: + price = 4000 +# ✅ ↓ Your code here ↓ ✅ + + +# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ +print('Your wedding will cost '+str(price)+' dollars') \ No newline at end of file diff --git a/.learn/resets/09-Random-Numbers/app.py b/.learn/resets/09-Random-Numbers/app.py new file mode 100644 index 00000000..9e4d5316 --- /dev/null +++ b/.learn/resets/09-Random-Numbers/app.py @@ -0,0 +1,8 @@ +import random + +def get_randomInt(): + # ✅ ↓ CHANGE ONLY THIS ONE LINE BELOW ↓ ✅ + random_number = random.random() + return random_number + +print(get_randomInt()) \ No newline at end of file diff --git a/.learn/resets/10-Calling-Your-First-Function/app.py b/.learn/resets/10-Calling-Your-First-Function/app.py new file mode 100644 index 00000000..7e7dd0aa --- /dev/null +++ b/.learn/resets/10-Calling-Your-First-Function/app.py @@ -0,0 +1,6 @@ +def is_odd(my_number): + return (my_number % 2 != 0) + + +def my_main_code(): + # ✅ ↓ Your code here ↓ ✅ \ No newline at end of file diff --git a/.learn/resets/10.1-Creating-Your-First-Function/app.py b/.learn/resets/10.1-Creating-Your-First-Function/app.py new file mode 100644 index 00000000..4db5352c --- /dev/null +++ b/.learn/resets/10.1-Creating-Your-First-Function/app.py @@ -0,0 +1,6 @@ +def add_numbers(a,b): + # This is the function's body ✅↓ Write your code here ↓✅ + + +# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ +print(add_numbers(3,4)) diff --git a/.learn/resets/11-Create-A-New-Function/app.py b/.learn/resets/11-Create-A-New-Function/app.py new file mode 100644 index 00000000..46b20099 --- /dev/null +++ b/.learn/resets/11-Create-A-New-Function/app.py @@ -0,0 +1,3 @@ +import random + +# ✅↓ Write your code here ↓✅ diff --git a/.learn/resets/12-Rand-From-One-to-Twelve/app.py b/.learn/resets/12-Rand-From-One-to-Twelve/app.py new file mode 100644 index 00000000..d7304410 --- /dev/null +++ b/.learn/resets/12-Rand-From-One-to-Twelve/app.py @@ -0,0 +1,8 @@ +import random + +def get_randomInt(): + # ✅↓ Write your code here ↓✅ + return None + +# ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ +print(get_randomInt()) diff --git a/.learn/resets/13-Your-First-Loop/app.py b/.learn/resets/13-Your-First-Loop/app.py new file mode 100644 index 00000000..542b4980 --- /dev/null +++ b/.learn/resets/13-Your-First-Loop/app.py @@ -0,0 +1,6 @@ +def start_counting(): + for i in range(10): + print(i) + return i + +start_counting() \ No newline at end of file diff --git a/.learn/resets/14-Create-A-For-Loop/app.py b/.learn/resets/14-Create-A-For-Loop/app.py new file mode 100644 index 00000000..19631c70 --- /dev/null +++ b/.learn/resets/14-Create-A-For-Loop/app.py @@ -0,0 +1,5 @@ +def standards_maker(): + # ✅↓ Write your code here ↓✅ + + +# ✅↓ remember to call the function outside (here) ↓✅ diff --git a/.learn/resets/15-Looping-With-FizzBuzz/app.py b/.learn/resets/15-Looping-With-FizzBuzz/app.py new file mode 100644 index 00000000..fff86955 --- /dev/null +++ b/.learn/resets/15-Looping-With-FizzBuzz/app.py @@ -0,0 +1,5 @@ +def fizz_buzz(): + # ✅↓ Write your code here ↓✅ + +# ❌↓ DON'T CHANGE THE CODE BELOW ↓❌ +fizz_buzz() diff --git a/.learn/resets/16-Random-Colors-Loop/app.py b/.learn/resets/16-Random-Colors-Loop/app.py new file mode 100644 index 00000000..0e29ead7 --- /dev/null +++ b/.learn/resets/16-Random-Colors-Loop/app.py @@ -0,0 +1,25 @@ +import random + +def get_color(color_number=4): + # Making sure is a number and not a string + color_number = int(color_number) + + switcher = { + 0:'red', + 1:'yellow', + 2:'blue', + 3:'green', + 4:'black' + } + + return switcher.get(color_number,"Invalid Color Number") + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ + +def get_allStudentColors(): + example_color = get_color(1) + students_array = [] + # ✅ ↓ your loop here ↓ ✅ + + +print(get_allStudentColors()) diff --git a/exercises/03-Print-Variables-In-The-Console/app.py b/exercises/03-Print-Variables-In-The-Console/app.py index f62f6922..9884859d 100644 --- a/exercises/03-Print-Variables-In-The-Console/app.py +++ b/exercises/03-Print-Variables-In-The-Console/app.py @@ -1 +1,5 @@ -# ✅ ↓ your code here ↓ ✅ \ No newline at end of file +# ✅ ↓ your code here ↓ ✅ +color = 'red' +item = 'marker' + +print(color +" "+ item) \ No newline at end of file diff --git a/exercises/04-Multiply-Two-Values/app.py b/exercises/04-Multiply-Two-Values/app.py index 83e80593..ca4e47da 100644 --- a/exercises/04-Multiply-Two-Values/app.py +++ b/exercises/04-Multiply-Two-Values/app.py @@ -1 +1,3 @@ # ✅ ↓ your code here ↓ ✅ +variables_are_cool = 2345 * 7323 +print(variables_are_cool) \ No newline at end of file diff --git a/exercises/05-User-Inputed-Values/app.py b/exercises/05-User-Inputed-Values/app.py index b569ee62..c62fd60d 100644 --- a/exercises/05-User-Inputed-Values/app.py +++ b/exercises/05-User-Inputed-Values/app.py @@ -1,4 +1,4 @@ age = int(input('What is your age?\n')) # ✅ ↓ CHANGE THE CODE BELOW TO ADD 10 TO AGE ↓ ✅ - +age = age + 10 print("Your age is: "+str(age)) \ No newline at end of file diff --git a/exercises/06-String-Concatenation/app.py b/exercises/06-String-Concatenation/app.py index 97521fb2..524b60d7 100644 --- a/exercises/06-String-Concatenation/app.py +++ b/exercises/06-String-Concatenation/app.py @@ -1,5 +1,6 @@ # ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅ - +my_var1 = 'Hello' +my_var2 = "World" ## Don't change anything below this line the_new_string = my_var1 + ' ' + my_var2 diff --git a/exercises/07-Create-a-Basic-HTML/app.py b/exercises/07-Create-a-Basic-HTML/app.py index ab15ceb0..bc4f873d 100644 --- a/exercises/07-Create-a-Basic-HTML/app.py +++ b/exercises/07-Create-a-Basic-HTML/app.py @@ -10,4 +10,5 @@ # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ # ✅ ↓ start coding below here ↓ ✅ - +html_document = e+c+g+a+f+h+d+b +print(html_document) diff --git a/exercises/08.1-Your-First-If/app.py b/exercises/08.1-Your-First-If/app.py index 6928dd3f..848c0bd0 100644 --- a/exercises/08.1-Your-First-If/app.py +++ b/exercises/08.1-Your-First-If/app.py @@ -1,3 +1,9 @@ total = int(input('How much money do you have in your pocket\n')) # ✅ ↓ YOUR CODE HERE ↓ ✅ +if total <= 50: + print("You are a poor guy, go away!") +elif total <= 100: + print("Buy me some coffee, you cheap!") +else: + print("Give me your money!") \ No newline at end of file diff --git a/exercises/08.2-How-Much-The-Wedding-Costs/app.py b/exercises/08.2-How-Much-The-Wedding-Costs/app.py index ad0a1008..889ae189 100644 --- a/exercises/08.2-How-Much-The-Wedding-Costs/app.py +++ b/exercises/08.2-How-Much-The-Wedding-Costs/app.py @@ -6,7 +6,12 @@ if user_input <= 50: price = 4000 # ✅ ↓ Your code here ↓ ✅ - +elif user_input <= 100: + price = 10000 +elif user_input <= 200: + price = 15000 +else: + price = 20000 # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ print('Your wedding will cost '+str(price)+' dollars') \ No newline at end of file diff --git a/exercises/09-Random-Numbers/app.py b/exercises/09-Random-Numbers/app.py index 9e4d5316..2fbfdd0d 100644 --- a/exercises/09-Random-Numbers/app.py +++ b/exercises/09-Random-Numbers/app.py @@ -2,7 +2,7 @@ def get_randomInt(): # ✅ ↓ CHANGE ONLY THIS ONE LINE BELOW ↓ ✅ - random_number = random.random() + random_number = random.randint(1,10) return random_number print(get_randomInt()) \ No newline at end of file diff --git a/exercises/10-Calling-Your-First-Function/app.py b/exercises/10-Calling-Your-First-Function/app.py index 7e7dd0aa..e53de21b 100644 --- a/exercises/10-Calling-Your-First-Function/app.py +++ b/exercises/10-Calling-Your-First-Function/app.py @@ -3,4 +3,5 @@ def is_odd(my_number): def my_main_code(): - # ✅ ↓ Your code here ↓ ✅ \ No newline at end of file + # ✅ ↓ Your code here ↓ ✅ + print(is_odd(45345)) \ No newline at end of file diff --git a/exercises/10.1-Creating-Your-First-Function/app.py b/exercises/10.1-Creating-Your-First-Function/app.py index 4db5352c..2d72fdd1 100644 --- a/exercises/10.1-Creating-Your-First-Function/app.py +++ b/exercises/10.1-Creating-Your-First-Function/app.py @@ -1,6 +1,6 @@ def add_numbers(a,b): # This is the function's body ✅↓ Write your code here ↓✅ - + return a + b # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ print(add_numbers(3,4)) diff --git a/exercises/11-Create-A-New-Function/app.py b/exercises/11-Create-A-New-Function/app.py index 46b20099..143cdab3 100644 --- a/exercises/11-Create-A-New-Function/app.py +++ b/exercises/11-Create-A-New-Function/app.py @@ -1,3 +1,7 @@ import random # ✅↓ Write your code here ↓✅ +def generate_random(): + result = random.randint(0,9) + return result +print(generate_random()) \ No newline at end of file diff --git a/exercises/12-Rand-From-One-to-Twelve/app.py b/exercises/12-Rand-From-One-to-Twelve/app.py index d7304410..17091a4e 100644 --- a/exercises/12-Rand-From-One-to-Twelve/app.py +++ b/exercises/12-Rand-From-One-to-Twelve/app.py @@ -2,7 +2,8 @@ def get_randomInt(): # ✅↓ Write your code here ↓✅ - return None + result = random.randrange(1,13) + return result # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ print(get_randomInt()) diff --git a/exercises/13-Your-First-Loop/app.py b/exercises/13-Your-First-Loop/app.py index 542b4980..2cc62064 100644 --- a/exercises/13-Your-First-Loop/app.py +++ b/exercises/13-Your-First-Loop/app.py @@ -1,5 +1,5 @@ def start_counting(): - for i in range(10): + for i in range(12): print(i) return i diff --git a/exercises/14-Create-A-For-Loop/app.py b/exercises/14-Create-A-For-Loop/app.py index 19631c70..7744f31a 100644 --- a/exercises/14-Create-A-For-Loop/app.py +++ b/exercises/14-Create-A-For-Loop/app.py @@ -1,5 +1,7 @@ def standards_maker(): # ✅↓ Write your code here ↓✅ - + for i in range(0,300): + print('I will ask questions if I am stuck') # ✅↓ remember to call the function outside (here) ↓✅ +(standards_maker()) \ No newline at end of file diff --git a/exercises/15-Looping-With-FizzBuzz/app.py b/exercises/15-Looping-With-FizzBuzz/app.py index fff86955..4555ff2c 100644 --- a/exercises/15-Looping-With-FizzBuzz/app.py +++ b/exercises/15-Looping-With-FizzBuzz/app.py @@ -1,5 +1,14 @@ def fizz_buzz(): # ✅↓ Write your code here ↓✅ + for i in range(1,101): + if i % 3 == 0 and i % 5 == 0: + print ("FizzBuzz") + elif i % 3 == 0: + print("Fizz") + elif i % 5 == 0: + print("Buzz") + else: + print(i) # ❌↓ DON'T CHANGE THE CODE BELOW ↓❌ fizz_buzz() From 4a3554bf8e8879aa0645d23f50ef32bd4a614424 Mon Sep 17 00:00:00 2001 From: bartowen <153402996+bartowen@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:06:15 +0000 Subject: [PATCH 3/3] avance --- .learn/resets/17-Russian-Roulette/app.py | 15 +++++++++++++++ .learn/resets/18-The-Beatles/app.py | 2 ++ .learn/resets/19-Bottles-Of-Milk/app.py | 1 + 3 files changed, 18 insertions(+) create mode 100644 .learn/resets/17-Russian-Roulette/app.py create mode 100644 .learn/resets/18-The-Beatles/app.py create mode 100644 .learn/resets/19-Bottles-Of-Milk/app.py diff --git a/.learn/resets/17-Russian-Roulette/app.py b/.learn/resets/17-Russian-Roulette/app.py new file mode 100644 index 00000000..e8704639 --- /dev/null +++ b/.learn/resets/17-Russian-Roulette/app.py @@ -0,0 +1,15 @@ +import random + +bullet_position = 3 + +def spin_chamber(): + chamber_position = random.randint(1,6) + return chamber_position + +# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ +def fire_gun(): + # ✅ ↓ your code here ↓ ✅ + return None + + +print(fire_gun()) diff --git a/.learn/resets/18-The-Beatles/app.py b/.learn/resets/18-The-Beatles/app.py new file mode 100644 index 00000000..d87e6fa1 --- /dev/null +++ b/.learn/resets/18-The-Beatles/app.py @@ -0,0 +1,2 @@ +# ✅↓ Write your code here ↓✅ + diff --git a/.learn/resets/19-Bottles-Of-Milk/app.py b/.learn/resets/19-Bottles-Of-Milk/app.py new file mode 100644 index 00000000..9733b0fc --- /dev/null +++ b/.learn/resets/19-Bottles-Of-Milk/app.py @@ -0,0 +1 @@ +# ✅↓ Write your code here ↓✅