Skip to content

Commit

Permalink
Day 1
Browse files Browse the repository at this point in the history
  • Loading branch information
neubrom committed Aug 23, 2021
1 parent 0756bbb commit 3afcfc3
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 0 deletions.
10 changes: 10 additions & 0 deletions 01/band-name-generator-start/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#1. Create a greeting for your program.
print("Welcome to the Generator")
#2. Ask the user for the city that they grew up in.
city = input("What is name of the city you grew up in\n ")
#3. Ask the user for the name of a pet.
pet = input("What is name of pet? \n")
#4. Combine the name of their city and pet and show them their band name.
print("Band Name: " + city + " " + pet)
#5. Make sure the input cursor shows on a new line, see the example at:
# https://band-name-generator-end.appbrewery.repl.run/
34 changes: 34 additions & 0 deletions 01/day-1-2-exercise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Debugging

# Instructions

Look at the code in the code editor on the left. There are errors in all of the lines of code. Fix the code so that it runs without errors.

**Warning:** The output in your program should match the example output shown below exactly, character for character, even spaces and symbols should be identical, otherwise the tests won't pass.

# Example Output

When you run your program, it should print the following:

```
Day 1 - String Manipulation
String Concatenation is done with the "+" sign.
e.g. print("Hello " + "world")
New lines can be created with a backslash and n.
```

e.g. When you hit **run**, there should be no errors and this is what should happen:

![](https://cdn.fs.teachablecdn.com/BVP20Z2T1Gb4Pi6rOQah)

# Test Your Code

Before checking the solution, try copy-pasting your code into this repl:

[https://repl.it/@appbrewery/day-1-2-test-your-code](https://repl.it/@appbrewery/day-1-2-test-your-code)

This repl includes my testing code that will check if your code meets this assignment's objectives.

# Solution

[https://repl.it/@appbrewery/day-1-2-solution](https://repl.it/@appbrewery/day-1-2-solution)
8 changes: 8 additions & 0 deletions 01/day-1-2-exercise/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Fix the code below πŸ‘‡

print("Day 1 - String Manipulation")
print("String Concatenation is done with the "+" sign.")
print('e.g. print("Hello " + "world")')
print("New lines can be created with a backslash and n.")


45 changes: 45 additions & 0 deletions 01/day-1-3-exercise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Inputs

# Instructions

Write a program that prints the number of characters in a user's name. You might need to Google for a function that calculates the length of a string.

e.g.

[https://www.google.com/search?q=how+to+get+the+length+of+a+string+in+python+stack+overflow](https://www.google.com/search?sxsrf=ACYBGNRxEaJIWyKHuWI0Lk24t4KuZVyeew:1579706585702&q=how+to+get+the+length+of+a+string+in+python+stack+overflow)

**Warning.** Your program should work for different inputs. e.g. any name that you input.

# Example Input

```
Angela
```

# Example Output

```
6
```

e.g. When you hit **run**, this is what should happen:

![](https://cdn.fs.teachablecdn.com/opevxYZSTM2ZHjbAX3XV)

# Hint

1. You can put functions inside other functions.
2. Don't try to print anything other than the length.

# Test Your Code

Before checking the solution, try copy-pasting your code into this repl:

[https://repl.it/@appbrewery/day-1-3-test-your-code](https://repl.it/@appbrewery/day-1-3-test-your-code)

This repl includes my testing code that will check if your code meets this assignment's objectives.


# Solution

[https://repl.it/@appbrewery/day-1-3-solution](https://repl.it/@appbrewery/day-1-3-solution)
11 changes: 11 additions & 0 deletions 01/day-1-3-exercise/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Write your code below this line πŸ‘‡

a = input("Input User name: ")
print(len(a))







51 changes: 51 additions & 0 deletions 01/day-1-4-exercise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Variables

# Instructions

Write a program that switches the values stored in the variables a and b.

**Warning.** Do not change the code on lines 1-4 and 12-18. Your program should work for different inputs. e.g. any value of a and b.

# Example Input

```
a: 3
```

```
b: 5
```

# Example Output

```
a: 5
```

```
b: 3
```

e.g. When you hit **run**, this is what should happen:

![](https://cdn.fs.teachablecdn.com/tgdNl0iSqK6RpPyYZh9d)

# Hint

1. You should not have to type any numbers in your code.
2. You might need to make some more variables.

# Test Your Code

Before checking the solution, try copy-pasting your code into this repl:

[https://repl.it/@appbrewery/day-1-4-test-your-code](https://repl.it/@appbrewery/day-1-4-test-your-code)

This repl includes my testing code that will check if your code meets this assignment's objectives.




# Solution

[https://repl.it/@appbrewery/day-1-4-solution](https://repl.it/@appbrewery/day-1-4-solution)
20 changes: 20 additions & 0 deletions 01/day-1-4-exercise/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 🚨 Don't change the code below πŸ‘‡
a = input("a: ")
b = input("b: ")
# 🚨 Don't change the code above πŸ‘†

####################################
#Write your code below this line πŸ‘‡

temp = a
a = b
b = temp

#Write your code above this line πŸ‘†
####################################

# 🚨 Don't change the code below πŸ‘‡
print("a: " + a)
print("b: " + b)


3 changes: 3 additions & 0 deletions 01/day-1-printing-end/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# input() will get user input in console
# Then print() will print the word "Hello" and the user input
print("Hello " + input("What is your name?"))
2 changes: 2 additions & 0 deletions 01/day-1-printing-start/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Write your code below this line πŸ‘‡
print("Hello World!")
Empty file removed 01/main.py
Empty file.

0 comments on commit 3afcfc3

Please sign in to comment.