[Python Programming Basics to Advanced]: Data Type Casting and fString | Lab 03 P-2

preview_player
Показать описание
This Python programming playlist is designed to take beginners with zero programming experience to an expert level. The course covers installation, basic syntax, practical scenarios, and efficient logic building. The course material includes PDF handouts, review questions, and covers a wide range of topics, from data types to advanced functions like Lambda and Recursive functions, Generators, and JSON data parsing.

In this lesson we will study about Data Type casting which can convert one data type to another. And we will also study about the concept of formatted string, also known as fstring.

Complete Playlist:

If you have the basic programming knowledge and interested to learn Object-Oriented Programming in Python, check out this playlist:

Lab Manual 03 can be downloaded from here:

Review Questions:
1- If name and registration of a student is stored in two variables as:
name='Ahmad Hussain'
reg='2019-MC-101'
Write a print statement using the fstring to print this welcome message:
Welcome Ahmad Hussain (2019-MC-101)!

#PythonProgramming #python #pythontutorial
Рекомендации по теме
Комментарии
Автор

name=input('Enter your name:\t')
reg=input('Enter your registration number:\t')
print(f'Welcome {name} ({reg})!')

muhammadalihaider
Автор

name="Maesha Ijaz"
reg="2019-MC-32"
print(f"Welcome {name} ({reg})!")

maeshaijaz
Автор

x = input('Enter your name.\n')
s=input(" your department name is:\n")
y = input('Enter the registration no. \n')

greeting= 'Welcome {name}; your department name is {department}, your registration no is {registration}'.format(name= x, department=s, registration=y)
print(greeting)

MuhammadQasim-erwb
Автор

2019-MC-41

name='Ahmad Hussain'
reg='2019-MC-101'
print(f"Welcome {name} ({reg})!")

zoniseithzoniseith
Автор

2019mc76
x = input('Enter your name.\n')
y = input('Enter the registration no. \n')

greeting= 'Welcome {name}; your registration no is {registration}'.format(name= x, registration=y)
print(greeting)

mukarmarashid
Автор

name="Usman Irshad"
reg="2019-MC-07"
print(f"Welcome {name} ({reg})!")

fourcloversan
Автор

name='Ahmad Hussain'
reg='2019-MC-101'
print(f"Welcome {name} ({reg})!")

arslanrafiq
Автор

name='Asmaa Bhatti'
reg='2019-MC-74'
print(f'Welcome {name} ({reg})!')

asmaabhatti
Автор

name='Ahmad Hussain'
reg='2019-MC-101'
print(f'Welcome {name} ({reg})!')

abdul-hadi
Автор

Name= 'Ahmad Hussain'
Reg= '2019-MC-100'
print(f"Welcome {Name} {Reg}!")

irsaidress
Автор

x = input('Enter your name.\n')
y = input('Enter the registration no. \n')

greeting= 'Welcome {name}; your registration no is {registration}'.format(name= x, registration=y)
print(greeting)

muhammadshess
Автор

name='Laveeza Yasin'
reg='2019-MC-73'
print(f"Welcome {name} ({reg})!")

laveezayasin
Автор

Name="Mujtaba Shabbir"
Reg="2019-MC-29"
print(f"Welcome {Name} ({Reg})!")

mujtabashabbir
Автор

name='Waleed Raza'
reg='(2019-MC-08)'
print(f'Welcome {name} {reg}!')

waleedraza
Автор

name='Ali Raza'
reg='2019-MC-19'

print(f'Welcome {name}({reg})!')

aliraza-zlft
Автор

name='Dawood Tahir '
reg='(2019-MC-10)'
print(f'Welcome {name} {reg}!')

dawood
Автор

Name ="Faraz Shah"
reg="2019-MC-30"
print(f'Welcome {name}({reg})!')

farazshah
Автор

h='Shahzaib Ali Afaq'
reg='(2019-MC-60)'
print(f'Welcome {h} {reg}!')

shahzaibaliafaq
Автор

name='Muhammad Ahmad'
reg='(2019-MC-14)'
print(f'Welcome {name} {reg}!')

muhammad-ahmad
Автор

name='Muhammad Ahmad'
reg='2019-MC-23'
print(f"Welcome {name} ({reg})!")

MuhammadAhmad-dshu
join shbcf.ru