Hello everyone! Wanted to apologize for all of the technical difficulties that occurred today that caused some delays and halts during class. Here are the resources we went over, the recordings will be sent via email!
Homework:
Giver 3 examples of each data type (2 for Boolean)
Create the variables name, grade, color, and another variable for something you like. Use f-strings/concatenation to print the following string but with your information.
Shravya is in 11th grade, and her favorite color is blue.
Shravya's favorite movie is Thor: Ragnarok.
Resources:
Class slides: https://docs.google.com/presentation/d/1sEZUlUHfWHJThTd8MP667DqFoJxvlKXwJfRNZZHwkoA/edit?usp=sharing
Class code: https://replit.com/@arnavpandey722/IntroToPython-Wk1Day1?v=1
Contact info:
shravyassathish@gmail.com (mentor)
mailtoarnavpandey@gmail.com (TA) Make sure to "Add a comment" with your code to the homework in order to submit your homework assignment!
#1:
a) int: integer
ex: 1, 2, 3
b) float: decimal
ex: 1.2, 0.75, 5.13
c) str: characters
ex: "name" "age" "week"
d) bool: boolean
ex: true, false
#2:
name = "Nilufar"
grade = 12
color = "pink"
movie = "The Intern"
print(f"{name} is in {grade} grade, and her favorite color is {color}.")
print(f"{name}'s favorite movie is {movie}.")
# Part 1: # str: strings of characters! # 1. "computer" # 2. "screen" # 3. "desk" # int: integer, self explanatory. # 1. 5 # 2. 9 # 3. 8 # float: decimal. # 1. 0.37 # 2. 0.98 # 3. 0.2 # bool: boolean. The two booleans are: # True # False # Part 2: name = "Julia" grade = "6th" color = "blue" food = "cake" print(f'{name} is in {grade} grade, and her favorite color is {color}.') print(f'{name}\'s favorite food is {food}.')
Xiyu(Stella):
1. str1='jello' print(type(str1)) str2='jelly' print(type(str2)) str3='jooce' print(type(str3)) in1=135795 print(type(in1)) in2=19768632 print(type(in2)) in3=10348685 print(type(in3)) fl1=1345.694 print(type(fl1)) fl2=19567.7034 print(type(fl2)) fl3=567.586 print(type(fl3)) boo1=True print(type(boo1)) boo2=False print(type(boo2)
2. name='Stella' grade='7th' color='black' movie='Minions' print(f'{name} is in {grade} grade, and her favourite color is {color}\n {name}\'s favorite movie is {movie}')
"Hello"
"Goodbye"
"Unicorn"
hii = -123
bye = 57684
cat = 12345687
dog = 8.25
fox = 9.12
kid = 4.5673
popcorn = True
chick = False
name = "Sabrina"
grade = "6"
color = "purple"
toy = "SQUISHMALLOWS"
print(name + " is in " + grade + "th Grade,", "and her favorite color is " + color +".")
print(name + " loves " + toy + "!!!!!")
Wesley:
print("Hi my name is Wesley I am 10 years old.")
print("My favorite animal is a snake”)
print("I like ping pong”)
W=True
print(W,sep=',')
Ilikepingpong=True
print(ilikepingpong=',')
print(3//2)
print(4*9)
print(1/4)
print(3.80/6.0)
print(4.30)
print(5.958291)
print ('Hi')
print ('there!')
print ('meowwwwwwww')
a = 78198
b = 82978192
c = 3819
x = 371.837201
y = 37.1111191
z = 192.378868017847
bool1 == True
bool2 == False
fname = 'Vanya'
lname = 'Chen'
print ('Hi! I am...')
print (fname + ' ' + lname)
grade = '5th'
print (f'and I am in {grade} grade.')
color = 'lavender'
print (f'My favorite color is {color}.')
fave_animal = 'cat'
print (f'My favorite animal is a {fave_animal}.\nMeow! =^-.-^=')
print("Hi my name is helen I am 10 years old.")
print("I ate 3 pies.")
print("I like Python")
G=True
print(G, sep=',')
IlikePython=True
print(IlikePython, sep=',')
print(5//3)
print(5*2)
print(1/3)
print(1.5/2.1)
print(2*1.5)
print(9*9.5433333333332)
#1:
str0 = "Fountain Pen" str1 = "Ball-point Pen" str2 = "Ultra-fine tip Pen" int0 = 72 int1 = -17 int2 = 293 float0 = 23.92 float1 = -0.24 float2 = 982.212 bool0 = True bool1 = False
#2 (f-strings):
name = "Eugene" grade = 6 fav_clr = "black" print(f"{name} is in {grade}th grade, and his favorite color is {fav_clr}.")
#2 (concatenation):
name = "Eugene" grade = "6"
#notice that grade is a string when using concatenation because you cannot join
#a string with an integer fav_clr = "black" print(name + " is in " + grade + "th grade, and his favorite color is " + fav_clr)
string1 = "hello1"
string2 = "a"
string3 = "bye"
integer1 = 8
integer2 = 89
integer3 = 641
float1 = 9.06
float2 = 4.1
float3 = 5.67
bool1 = True
bool2 = False
name = "Brian"
grade = 1
favColor = "red"
movie = "Ratatouille"
print(f'{name} is in {grade}st grade, and his favourite color is {favColor}.\n{name}\'s favourite movie is {movie}.')
Ernie
#1 #Str s1 = 'Ball' s2 = 'dog' s3 = 'cat' #int n1 = 123 n2 = 3 n3 = -1 #float f1 = 0.23 f2 =1.3 f3 = 4.23 #bool b1 = True b2 = False #code print(type(s1)) print(type(s2)) print(type(s3)) print(type(n1)) print(type(n2)) print(type(n3)) print(type(f1)) print(type(f2)) print(type(f3)) print(type(b1)) print(type(b2))
#2 name = 'Name' grade = '123' color = 'red' v1 = 'thing' print(name + " is in " + grade + " grade, and his favorite color is " + color + ".") print(f'{name}\'s favorite thing is {v1}.')