# PYTHON BASIC EXERCISES
message:str="sir g thora sa makhan lga lun?" print(message.title()) #2. Simple MEssage textsms:str="sir ap buhat acha parhatay hain" print(textsms.title()) textsms:str="sir g ab tu full number bantay!" print(textsms.title())
name:str='Khurram' print(f'Hello {name} would you like to learn python today?')
y:str='Khurram' print(y.lower()) print(y.upper()) print(y.title())
quote:str='"Courage is what all matters."' name:str="QUAID E AZAM" print(f"{name} said that, {quote}".title())
famous_person:str='QUAID E AZAM' message:str="is a hardworking person." print(f"{famous_person} {message}".title())
name = 'Khurram Shahzad' print("Original Name for white space") print(f"{name}") print(" \nname after lstrip():") print(f"{name}".lstrip()) print("name after rstrip(): ") print(f"{name}".rstrip()) print(" \nname after strip(): ") print(f"{name}".strip())
x:int y:int z:int x,y,z = 11, 19, 22 print(x+y+z)
a=19 b=13 print("Before swap:") print("a =",a) print("b ",b) a, b = b, a print("After swap:") print("a =",a) print("b =",b)
favourite_colour='Black' print(f"My favourite colour is {favourite_colour}") new_colour='Black' print(f"My T shirt colour is {new_colour}")
Pet_name='dog' Pet_name='cat' print(f"the new pet name is {Pet_name}")
#- Assign the value "Sunshine" to a variable and print it. Then mistakenly try to print a variable with a different name (like sunshine) and observe the error. sunshine:str='Sunshine'
score=96 print(f"My old score is {score}") score=100 print(f"My new score is {score}")
city="Lahore" print(f"I live in {city}")
text=" python programming" print(f"{text}.".title())
mixedcase='PYthoN PRogramMING' print(f"{mixedcase}".lower())
mixedcase='pyTHOn proGraming' print(f"{mixedcase}".upper())
temperature='35' print(f"the highest temperature is {temperature} degree")
poem='''Beneath the sky so vast and blue,
The world awakens fresh and new.
Each dawn brings light, each dusk brings peace,
In nature's rhythm, troubles cease.'''
print(poem)
