# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Watch Me Code 1: Yes Or No
#
# Our approach
#
# 1. take input "yes" or "no"
# 1. convert to lower case
# 1. slice off first character and return it!
#

dir(str)

help(str.lower)

x = "Nick"
x.lower()


# +
def YesOrNo(text):
    first_char = text[0]
    first_char = first_char.lower()
    if "y" == first_char:
        return True
    elif "n" == first_char:
        return False
    else:
        return None
        
x = input("Please enter y/n, or yes/no")
result = YesOrNo(x)
if result is None:
    print("Please enter a y/n")
elif result:
    print("You entered Yes")
elif not result:
    print("You entered No")
# -

x="EDISON" 
x.lower()


# +
def YesOrNo(text) 
    first_char=text(0) 
    first_char=first_char.lower() 
    if "y" ==first_char: 
        return True 
    elif "n" ==first_char:
        return False 
    else: 
        return None 
    
x=input("please enter y/n or yes/no") 
result=YesOrNo(x) 
if result is None: 
    print("please enter a y/n") 
elif result 
    print("you enter YES") 
elif not result: 
    print("loser")
# -

x="Mike" 
y=x.upper().replace("I","K") 
print (y)

# +
raw="12 45 96" 

token=raw.split(" ") 
total = 0 
for token in tokens: 
    total=total+int(token) 
    
print("your total is %d" %(total))
# -



StarcoderdataJupyterScriptsDedupFiltered