Saturday, December 26, 2020

 def turn_right():

    turn_left()

    turn_left()

    turn_left()

    

def jump():

    turn_left()

    while wall_on_right():

          move()

    turn_right()

    move()

    turn_right()

    while front_is_clear():

              move()

    turn_left()

while not at_goal():

    if wall_in_front():

       jump()

    else:

        move()

Saturday, December 5, 2020

love calculator

print("Welcome to the Love Calculator!")
name1 = input("What is your name? \n")
name2 = input("What is their name? \n")
# 🚨 Don't change the code above 👆

#First *fork* your copy. Then copy-paste your code below this line 👇
#Finally click "Run" to execute the tests
t = (name1.count('t') + name2.count('t'))
r = (name1.count('r') + name2.count('r'))
u = (name1.count('u') + name2.count('u'))
e = (name1.count('e') + name2.count('e'))
total = str(t + r + u + e)

l = (name1.count('l') + name2.count('l'))
o = (name1.count('o') + name2.count('o'))
v = (name1.count('v') + name2.count('v'))
e = (name1.count('e') + name2.count('e'))
total1 = str(l + o + v + e)

score = int(total + total1)

if score <= 10 or score >= 90:
print(f'your score is {score} you are like coke and mentos')
elif score >= 40 and score <= 50:
print(f'your score is {score} you are alright together!')
else:
print(f'your score is {score}')

Saturday, November 28, 2020

 print('wellcome!')

bill = float(input('what is the total? '))
split = int(input('how many people are there? '))
tip = int(input('how much tip will you enter,10,12 or 15 euro? '))

bill_with_tip = tip / 100 * bill + bill
print(bill_with_tip)
result = (bill_with_tip / split)
total = round(result, 2)
print(f"each person should pay ${total}")

Friday, November 27, 2020

cost = input("how much is the bill? ")
total=int(cost)*1.125
print(total)
people=input("how many people you are? ")
share_perperson = total/int(people)
print(round(share_perperson, 2))

Thursday, November 26, 2020

 leftyears=(90-int(age))


print(f"You have {365*leftyears} days, {52*leftyears} weeks, and {12*leftyears} months left.")

Wednesday, November 25, 2020

 two_digit_number = input("Type a two digit number: ")

a = two_digit_number[0]
b = two_digit_number[1]

int_a = int(a)
int_b = int(b)

print(int_a + int_b)👍

Monday, March 30, 2020

coroa vierus

advises = []

for x in range(5):
    advise =input("this is what you have to do to stay away from covid 19  ")
    advises.append(advise)

for advise in advises:
    print(advise)

Thursday, February 20, 2020

birthday

birthday

theme = input("what is your birthday theme? ")
main_color = input("What is your main color? ")
guests_number = int(input("How many people are you inviting? "))

guests_name = []

for i in range(guests_number):
    message = "Please enter guest " + str(i + 1) + " name: "
    name = input(message)
    guests_name.append(name)
   

print("My birthday theme is " + theme)
print("My main color for the birthday is " + main_color)

for guest in guests_name:
    print("I would like to invite " + guest + " to come to my birthday on may 13th.")
   
   
print("I am looking forward to seeing you in my party :) :)")

Sunday, January 12, 2020

new year resolutions

def make_resolutions():
    year = input("What is the year?")
    number_of_goal = int(input("How many goals do you want to set for this yea?"))

    goals = list()
    # goals = []
    for i in range(number_of_goal):
        goal = input("Please enter your goal: ")
        goals.append(goal)


    print("\nHere is the resolutions for year ", year)
    print("---------------------------")
    for goal in goals:
        print(goal)

make_resolutions()

Wednesday, January 1, 2020

casino

import random

betters = []

number_of_people_str = input("How many people are betting? ")
number_of_people = int(number_of_people_str)

for better in range(number_of_people):
    betters.append(input("Enter the name of better: "))

betters.append("Casino")


amount_to_bet = int(input("How much do you want to bet? "))

round_to_bet = int(input("How many time do you want to bet? "))

total_amount = number_of_people * amount_to_bet


for round in range(round_to_bet):
    random_winner = random.randint(0,number_of_people)
    print(betters[random_winner]," won " ,total_amount)

Friday, December 20, 2019

money converter

def dollars_to_euros(amount):
    return amount * .9


def euro_to_dollar(amount):
    return amount * 1.11


print(dollars_to_euros(1))

print(euro_to_dollar(100))

class lesson person and car

class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age


def print_person(person):
    print("My name is ",person.name, " and i am " ,person.age, " years old")

ali = Person("ali", 43)

print_person(ali)
     
sonia = Person("sonia", 8)

print_person(sonia)

mum = Person("Solmaz", 37)

print_person(mum)






class Car:
  def __init__(self,name, color):
      self.name = name
      self.color = color
 

def print_car(car):
    print("I am a ", car.color, " ", car.name, " car.")

rusty = Car("Rusty", "Gray")
mum_car = Car("Mum", "Gray")
sonia_car = Car("pinkyyyyy", "Pink")
tina_car = Car("yellowwww","yellow")

print_car(rusty)
print_car(mum_car)
print_car(sonia_car)
print_car(tina_car)

Wednesday, December 18, 2019

car registration number

import string

import random



def register_car_number():

    alphabet = list(string.ascii_uppercase)

#     ["A","B",....,"Z"]

    

    letter1 = alphabet[random.randint(0,26)]

    letter2 = alphabet[random.randint(0,26)]

    letter3 = alphabet[random.randint(0,26)]

    

    num1 = random.randint(0,9)

    num2 = random.randint(0,9)

    num3 = random.randint(0,9)

    



    month = input("Please enter the month the car is made ")

    year = input("Please enter the year the car is made ")



    car_number = letter1 + letter2 + letter3 +" " + month + " " + year + " "+ str(num1) + str(num2) + str(num3)

    print("Here is your car registeration number: ", car_number )



    

    

register_car_number()



    

Thursday, December 12, 2019

christmas whishes game

christmas_wishes = ["bicycle","teddy bear", "ball"]
scrambled_words = ["cylebi","rabe yddet","lbal"]

def play():
    for position, word in enumerate(scrambled_words):
        guess = input("Guess what is this scrambled word: "+ word)
       
        if position == 0:
            if guess == christmas_wishes[0]:
                print("Correct answer: ", guess)
            else:
                print("Sorry you were wrong")
        elif position == 1:
            if guess == christmas_wishes[1]:
                 print("Correct answer: ", guess)
            else:
                 print("Sorry you were wrong")
        else:
            if guess == christmas_wishes[2]:
                 print("Correct answer: ", guess)
            else:
                 print("Sorry you were wrong")
                     
                     
                     
                     
play()

Monday, December 9, 2019

santa post office

letters = []
def write_letter(message):
    letters.append(message)
   
   
def post_letter(letters):
    print("\nSanta got your letters and soon will bring you what you asked for\n")
    for letter in letters:
        print(letter)
       

for i in range(4):
    message = input("Please write your message for santa: ")
    write_letter(message)
   
post_letter(letters)

Friday, December 6, 2019

add numbers

def add(a,b):
    return int(a) + int(b)


num1 = input("please enter number 1 ")
num2 = input("please enter number 2 ")

answer = add(num1,num2)

print("Here is the addition of ", num1 ,"+",num2 ,"=",answer)

find number

nums = [1,2,3,4,5,6,7,8,9]

def find_num(num):
    for item in nums:
        if item == int(num):
            return num
     
    print("Could not find the number ",num)
 
 
inupt = input("what number you like to search?")
print(find_num(input))

Wednesday, December 4, 2019

This is a game Sonia made for Christmas

This is a game Sonia made for Christmas

def play_christmas():
    gifts = {}
    mumber_of_gifts = input("Santa says: How many people are in your family?")
   
    for x in range(int(mumber_of_gifts)):
        name = input("What is your name?")
        gift = input("What do you want Santa(me) to bring for?")
       
        gifts[name] = gift
   
    for name, gift in gifts.items():
        print("Santa is going to bring ",gift, " for ", name)
   
   
play_christmas()

Tuesday, November 26, 2019

Give thanks for

def give_thanks():
    name = input("What is your name?")
 
    for i in range(5):
        answer = input("What do you want to thank God for?")
        print(name," gives thanks to God for ",answer)



give_thanks()

Sunday, November 24, 2019

Song maker

from time import sleep

def give_thanks():
    wait_time = 5
    for x in range(2):
        print_verse("Give thanks with grateful heart", wait_time)
        print_verse("Give thanks to the holy one", wait_time)
        print_verse("Give thanks to the holy one, beacuse he is given us Jesus christ", wait_time)
        for x in range(3):
            print()
            sleep(1)
            
    for x in range(2):
        print_verse("and now let the weak say i am strong",wait_time)
        print_verse("and poor say i am rich",wait_time)
        print_verse("because of what the Lord has done for us",wait_time)
        for x in range(3):
            print()
            sleep(1)
        
    
    
    
    
def print_verse(verse,sleep_time):
    print(verse)
    sleep(sleep_time)
    

give_thanks()