Exponential Startup!

  Last task in this part 1 of this week was Exponential Startup! In this program for every initial customer, I had to calculate how many years it will take for everyone to be a a customer. In this I looped it and used the information to complete the maths in the equation.

42 Bath Temperature


42 is the "perfect" temperature for a bath. For this program I need to code a program that asked the user what the temperature is and the response should tell you whether it is too hot or too cold. Also if it is at 42 it has to say Just Right! In this I used true and if statements with a break to stop the loop when you get to just right!

What's the magic word ?

What's the magic word - For this task we had to ask the user "What's the magic word?". This was based on the children that don't say the magic word, in this case please.We also needed to program it so that it would accept upper,lower and mixed letters.
-
s = ""
while s != 'please' not in s.lower():
  s = input("What's the magic word?")
print("OK!")

Counting Sheep

Counting Sheep is based on the idea of counting sheep to fall asleep, instead we are writing a program to do it for us. This whole program is looping, increasing the number of sheep each time
-
s = int(input("How many sheep: "))
i = 1
while i < s + 1:
  print(i, "sheep")
  i += 1