Skip to content

Latest commit

 

History

History
134 lines (89 loc) · 2.19 KB

Day 1.md

File metadata and controls

134 lines (89 loc) · 2.19 KB

image

Solution:

x = 5
y = -2
print (x + y)

image

Solution:

x = 2.34
y = 10.00009
print(x + y )

image

Solution:

x = "Hello world"
print(x)

image

Solution:

x = True
print(x)
y = False
print(y)

image

Solution:

a = 32
b = "Fire"
c = 99.99
d = False
print(type(a))
print(type(b))
print(type(c))
print(type(d))
a = 8.1
print(type(a)) # The data type of a variable can change

image

Solution:

a = 5
b = "5"
print(type(a))
print(type(b))

image

Solution:

a = "Code"
b = "Chef"
print(a+ b )

image

Solution:

a = "Python"
print(a[2])

image

Solution:


b = "Python is fun"
print(b[:5]) 
print(b[2:13])
print(b[3:6])
print(b[0:2])

image

Solution:

a = b = c = "Python"
print(a, "?", b, "?", c)

image

Solution:

a = "Bootstrap"
b = "TYPESCRIPT"
print( a.upper()) #print the string a in upper case
print( b.lower() ) #print the string b in lower case
c = "Welcome to ChefCode! You can learn Python with ChefCode"
d = c.replace("ChefCode", "CodeChef")
print(d)