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
    Sep 15, 2021

    9/14 - Class 1 HW + Resources

    in Introduction to Python

    Hi everyone, hope you had a great first class!


    RESOURCES:

    Class slides: https://docs.google.com/presentation/d/1QYxtxPQ2aYn4e7HWUbLPgZIO43LFtU6Tu8G8GVM7BlE/edit?usp=sharing

    Example code: https://replit.com/@ShravyaS/IntroToPython

    Coding platform: replit.com

    Join the Discord (if you can): https://discord.gg/Am6Y3r2y

    (You can always ask for help under #intro-python)


    In addition, here's a quick recap:

    - Python is a programming language that's readable and user-friendly.

    - In repl.it, the left side is the editor and the right side is the console. Code goes in the editor, output in the console.

    - Variables are like a box that contain values.

    - Datatypes are types of values, and they include strings, ints, floats, booleans, and more.

    - Strings = chain of characters (ex: "Hello!")

    - Integers = numbers (ex: 9)

    - Floats = decimals (ex: 2.5) - Boolean = True or False

    - Variables can be created, reassigned, or printed (with other values, too.)


    HOMEWORK:

    1. Give 3 examples each (different from the slides) of integers, floats, and strings. (9 in total.)

    2. Write a program that stores 2 variables: a title (like "Sir" or "Mr.") and a name. What data type is best to use for these two variables? Have the program print out "Hello, {title} {name}"


    Post your answers as a comment! We'll post solutions before next class.

    8 comments
    0
    jliu.mky
    Sep 15, 2021
    1. -3, 5, 8; 1.1, 2.4, 4.7; "Dog", "Bird", "Smart boy"

    2. String as data type

    title = "Mr." name = "Yuki" print("Hello,", title, name)

    0
    Sanjeet Sathish
    Sep 18, 2021

    1. Integer: 7, 4, -3; Float: 1.5, 4.6, 10.99; String: "Whale", "human", "Monkey"


    2. title = "Sir"

    name = "Lancelot"

    print("Hi", title, name)

    0
    Eric Wu
    Sep 20, 2021

    Hi everyone, here are some possible solutions to the homework

    1. Integers: 3, 4, -8

    Floats: 1.2, 4.8, -8.0

    Strings: "Happy", "13", 'Hi, how are you?'


    2. The best variable type to use here is a string

    title = "Mr."

    name = "Smith"

    print("Hello,", title, name)

    0
    yujie7611
    Sep 21, 2021

    1. Integers:3,4,5

    Floats:1.2,3.4,5.678910

    Strings: “Happy”, “One hundred seventy two”, “Hello, nice to meet you.”


    2.The best variable type to use here is a string.

    Title=“Sir”

    Name=“Braginski”

    print(“Hello,”,title,name)

    0
    joelamma
    Sep 22, 2021
    1. intigers 100000000000000000000000000000000000000000000000000000 , 10000000000000000000000000000000000000000000000000000000000000000,100000000000000000000000000000000000000000000000000000000000000

    2. the best varible is a string Title="Fat"

    name="Joe liama"

    print("Hello",title,name)

    0
    Shravya S
    Sep 22, 2021

    For number 1, it'd be great if you could include examples of floats and strings too!

    0
    1337kid
    Sep 22, 2021
    1. Integers, (1,3,7)

    2. 1.3, 3.7 1.337

    3. "genius", "heckerpro", "1337aboveyou


    me= "prohecker"

    1337=moi

    print("me","1337")

    0
    athenawang0406
    Sep 29, 2021

    Ints: 7, 1000000, and 15. Floats: 12.756, 0.1, and 10.981. Strings: "I'm hungry", "Tomato's", and "Cats are cool".


    title = "Ms."

    name = "person"

    print("hello", title, name)

    0
    8 comments

    Questions? Email us at legionoflearners@gmail.com or join our WeChat group!

    • lol-101dotcom

    ©2020 Legion of Learners