logotransparent.png

Legion of Learners

www.lol-101.com

  • Home

  • Classrooms

  • Courses

  • About Us

    • Executive Team
    • Board Members
  • Resources

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    Shravya S
    Jun 12

    6/12 - Homework Week 1 Day 2

    in Introduction to Python

    RESOURCES:

    Class slides: https://docs.google.com/presentation/d/1kY_YhPN9f8OI-mVB-gzk6ukoakYycvhzds_2g96ofIk/edit?usp=sharing

    Code from class: https://replit.com/@ShravyaS/IntroToPython-Wk1Day2

    Coding platform: replit.com

    HOMEWORK:

    1. Write a program that takes two inputs and stores them in variables feet and inches. Print output of their height in only inches. (12 inches = 1 foot)

    2. Using the six comparison operators and three logical operators, write two expressions that are true and two expressions that are false.

    Post your answers as a comment! Solutions will be posted later (we'll also go over it next class).

    Feel free to email shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) if you're stuck or have questions! See you :)

    10 comments
    0
    melodychangchang
    Jun 13
    1. Program:

    start=input("Hello, Homo sapien. Do you want to input a height in feet and inches? This program will output the height in only inches. (yes/no): ")

    if start=="yes":

    feet=input("Input the Feet: ")

    inches=input("Input the Inches: ")

    feet=int(feet)

    inches=int(inches)

    height=feet*12+inches

    print("The Height in Inches:", height,"\n Goodbye.")

    elif start=="no":

    print("Goodbye.")

    else:

    print("I don't understand. Goodbye.")

    1. Four Expressions:

    a. True expressions:

    1. 3.0>=1 and 4!=1

    2. True or 5==9

    b. False expressions:

    1. not (2<6 and 5!=3)

    2. 5>=8 or 9<=7

    0
    justannie2019
    Jun 13

    def inchheight(f,i):

    inch = f * 12 + i

    return(inch)


    def realheight(i):

    foot = i // 12

    inch = i % 12

    if foot == 1:

    j = foot, "foot"

    else:

    j = foot, "feet"

    if inch == 1:

    k = inch, "inch"

    else:

    k = inch, "inches"

    return j,k


    True

    4 > 3 OR 5 == 7

    NOT 4 < 9


    False

    3 <= 3 AND 8 != 8

    NOT 5 >= 3


    This looks too confusing

    0
    davidkouhouchin
    Jun 13

    #feet to inches

    inches = input("feet: ")

    feet = int(inches) * 12


    #inches to feet

    feet1 = input("inches: ")

    inches = int(feet1) // 12


    #Expressions

    #True

    4>3 or 3<4

    3>=3 and 3>2


    #False

    4<3 or 3>4

    3>3 and 3<2

    0
    Darrin Lin
    Jun 14

    print("Hello would you like to see your height in inches?")

    feet=input("Put your feet: ")

    inches=input("Put your inches: ")

    feet=int(feet)

    inches=int(inches)

    height=inches+feet*12

    print("Your height in inches is " + str(height)) #True

    print (5!=6 and 5>3)

    print (5>=5 or 6==9)

    #False

    print (4==1 and 4==4)

    print (7>=9 or 3>7)

    0
    chiao_chuanhung
    Jun 14

    #Homework Wee2 : Problem 1

    print("What is your height?")

    feet = input("Feet= ")

    inch= input("Inch= ")

    height=int(feet)*12+int(inch)

    print("Your height = "+str(height)+" inches")



    #Homework Week2 : problem 2

    #True

    print( 5==5 or 9>=10 )

    print( not(3==4))


    #False

    print(8<=-1 or not(1.5>=0.9))

    print( "Apple"=="apple" and ("ICE"=="ICE"))

    0
    Eric Wu
    Jun 15

    Hi everyone, sorry I wasn't there for the 2 classes, I was out in Florida. I'll be posting homework solutions here. If you need other examples you can also look at solutions from other students.


    Part 1

    inches = int(input())

    feet = int(input())

    print(inches+(12*feet))


    Part 2

    5<6 (true)

    8!=7 (true)

    5<5 (false)

    3==4 (false)

    0
    ericwangbigpro
    Jun 15

    feet = input("How many feet is this")

    inches = int(feet)*12

    print(f'It is {feet} feet or {inches} inches.')

    0
    ericwangbigpro
    Jun 15

    feet = input("How many feet is this")

    inches = int(feet)*12

    print(f'It is {feet} feet or {inches} inches.')

    0
    lshirleys2008
    Jun 16

    print("Find your height in inches.")

    ft = input("Write you height in feet: ")

    inch = input ("Write your inches height: ")