From 61a1e09901e266dbb78679777324869f1a341a3a Mon Sep 17 00:00:00 2001 From: Clara Espinosa Pantoja Date: Tue, 4 Mar 2025 21:53:05 +0000 Subject: [PATCH] ej11 --- .learn/resets/01-Console/app.py | 1 + .learn/resets/02-Declare-Variables/app.py | 1 + .../resets/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 +++ .../resets/08.2-How-Much-The-Wedding-Costs/app.py | 12 ++++++++++++ .learn/resets/09-Random-Numbers/app.py | 8 ++++++++ .learn/resets/10-Calling-Your-First-Function/app.py | 6 ++++++ exercises/01-Console/app.py | 3 ++- exercises/02-Declare-Variables/app.py | 4 ++++ exercises/03-Print-Variables-In-The-Console/app.py | 7 ++++++- exercises/04-Multiply-Two-Values/app.py | 2 ++ exercises/05-User-Inputed-Values/app.py | 2 +- exercises/06-String-Concatenation/app.py | 4 ++-- exercises/07-Create-a-Basic-HTML/app.py | 2 +- exercises/08.1-Your-First-If/app.py | 6 ++++++ exercises/08.2-How-Much-The-Wedding-Costs/app.py | 7 ++++++- exercises/09-Random-Numbers/app.py | 2 +- exercises/10-Calling-Your-First-Function/app.py | 3 ++- 22 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 .learn/resets/01-Console/app.py create mode 100644 .learn/resets/02-Declare-Variables/app.py 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 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/.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/exercises/01-Console/app.py b/exercises/01-Console/app.py index ff00ab34..87b1fc83 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..5f898513 100644 --- a/exercises/02-Declare-Variables/app.py +++ b/exercises/02-Declare-Variables/app.py @@ -1 +1,5 @@ # ✅ ↓ your code here ↓ ✅ + +color = "Yellow" + +print(color) \ No newline at end of file diff --git a/exercises/03-Print-Variables-In-The-Console/app.py b/exercises/03-Print-Variables-In-The-Console/app.py index f62f6922..1832e2af 100644 --- a/exercises/03-Print-Variables-In-The-Console/app.py +++ b/exercises/03-Print-Variables-In-The-Console/app.py @@ -1 +1,6 @@ -# ✅ ↓ 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..818c9c47 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..de59359b 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 ↓ ✅ -print("Your age is: "+str(age)) \ No newline at end of file +print("Your age is: "+str(age + 10)) \ No newline at end of file diff --git a/exercises/06-String-Concatenation/app.py b/exercises/06-String-Concatenation/app.py index 97521fb2..e4e7cef8 100644 --- a/exercises/06-String-Concatenation/app.py +++ b/exercises/06-String-Concatenation/app.py @@ -1,6 +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 print(the_new_string) diff --git a/exercises/07-Create-a-Basic-HTML/app.py b/exercises/07-Create-a-Basic-HTML/app.py index ab15ceb0..2fcabc12 100644 --- a/exercises/07-Create-a-Basic-HTML/app.py +++ b/exercises/07-Create-a-Basic-HTML/app.py @@ -10,4 +10,4 @@ # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ # ✅ ↓ start coding below here ↓ ✅ - +print(e+c+g+a+f+h+d+b) diff --git a/exercises/08.1-Your-First-If/app.py b/exercises/08.1-Your-First-If/app.py index 6928dd3f..d2caa7ab 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 > 100: + print("Give me your money!") +elif total > 50: + print("Buy me some coffee, you cheap!") +else: + print("You are a poor guy, go away!") \ 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