Day1

x = 2
type(x)
int

this is our first day

# Hi
y=3
z=x+y
z=5
y= x+z
a = z*2
a
10
print(a)
10

string1 = "Hello"
string1[0] = 's'
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-d7321e158002> in <module>
----> 1 string1[0] = 's'

TypeError: 'str' object does not support item assignment
keerthi = [1,2,3.4,'Hi',[3,4,5]]
keerthi[0]=5
keerthi
[5, 2, 3.4, 'Hi', [3, 4, 5]]
mylist[1:]
[2, 3.4, 'Hi', [3, 4, 5]]
mylist[4][1]
4
x = 1
y = str(x)
y
'1'
z = float(x)
z
1.0
a = 'Hi'
b = int(a)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-30-8bc774163872> in <module>
----> 1 b = int(a)

ValueError: invalid literal for int() with base 10: 'Hi'
keerthi
[5, 2, 3.4, 'Hi', [3, 4, 5]]
age = 28
print("My age is" + age)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-36-49fc4b0318e5> in <module>
----> 1 print("My age is" + age)

TypeError: can only concatenate str (not "int") to str
type(age)
int
print("My age is" + str(age))
My age is28

print("My age is",age)
My age is 28

print(f"my age is {age}")
my age is 28

mylist = [1,2,3]
sum(mylist)
6
sum
<function sum(iterable, start=0, /)>