Coding Explained #3

Basics of Python Programming Introduction to Python Programming for Beginners
5 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€45.89
List Price:  €64.25
You save:  €18.35
£39.47
List Price:  £55.26
You save:  £15.79
CA$68.07
List Price:  CA$95.30
You save:  CA$27.23
A$74.60
List Price:  A$104.44
You save:  A$29.84
S$67.28
List Price:  S$94.20
You save:  S$26.92
HK$390.05
List Price:  HK$546.10
You save:  HK$156.05
CHF 45.58
List Price:  CHF 63.82
You save:  CHF 18.23
NOK kr536.92
List Price:  NOK kr751.73
You save:  NOK kr214.81
DKK kr343.16
List Price:  DKK kr480.45
You save:  DKK kr137.29
NZ$81.48
List Price:  NZ$114.09
You save:  NZ$32.60
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.46
৳5,823.25
List Price:  ৳8,153.02
You save:  ৳2,329.76
₹4,164.19
List Price:  ₹5,830.20
You save:  ₹1,666.01
RM234.32
List Price:  RM328.07
You save:  RM93.75
₦73,485.30
List Price:  ₦102,885.30
You save:  ₦29,400
₨13,851.69
List Price:  ₨19,393.48
You save:  ₨5,541.78
฿1,799.30
List Price:  ฿2,519.17
You save:  ฿719.86
₺1,611.84
List Price:  ₺2,256.71
You save:  ₺644.86
B$255.17
List Price:  B$357.27
You save:  B$102.09
R916.27
List Price:  R1,282.86
You save:  R366.58
Лв89.93
List Price:  Лв125.91
You save:  Лв35.97
₩67,705.95
List Price:  ₩94,793.75
You save:  ₩27,087.80
₪184.61
List Price:  ₪258.47
You save:  ₪73.85
₱2,891.92
List Price:  ₱4,048.92
You save:  ₱1,156.99
¥7,782.19
List Price:  ¥10,895.69
You save:  ¥3,113.50
MX$830.26
List Price:  MX$1,162.43
You save:  MX$332.17
QR181.35
List Price:  QR253.91
You save:  QR72.55
P673.81
List Price:  P943.39
You save:  P269.57
KSh6,489.45
List Price:  KSh9,085.75
You save:  KSh2,596.30
E£2,340.40
List Price:  E£3,276.75
You save:  E£936.34
ብር2,856.35
List Price:  ብር3,999.12
You save:  ብር1,142.76
Kz42,441.51
List Price:  Kz59,421.51
You save:  Kz16,980
CLP$44,715.94
List Price:  CLP$62,605.89
You save:  CLP$17,889.95
CN¥361.08
List Price:  CN¥505.55
You save:  CN¥144.46
RD$2,913
List Price:  RD$4,078.44
You save:  RD$1,165.43
DA6,730.70
List Price:  DA9,423.52
You save:  DA2,692.82
FJ$111.38
List Price:  FJ$155.95
You save:  FJ$44.56
Q386.36
List Price:  Q540.94
You save:  Q154.57
GY$10,404.04
List Price:  GY$14,566.49
You save:  GY$4,162.45
ISK kr6,889.99
List Price:  ISK kr9,646.55
You save:  ISK kr2,756.55
DH495.11
List Price:  DH693.20
You save:  DH198.08
L879.91
List Price:  L1,231.95
You save:  L352.03
ден2,826.97
List Price:  ден3,957.99
You save:  ден1,131.01
MOP$399.64
List Price:  MOP$559.54
You save:  MOP$159.89
N$909.80
List Price:  N$1,273.79
You save:  N$363.99
C$1,830.66
List Price:  C$2,563.07
You save:  C$732.41
रु6,629.71
List Price:  रु9,282.12
You save:  रु2,652.41
S/185.70
List Price:  S/260
You save:  S/74.29
K193.11
List Price:  K270.37
You save:  K77.26
SAR187.46
List Price:  SAR262.46
You save:  SAR75
ZK1,269.30
List Price:  ZK1,777.13
You save:  ZK507.82
L228.76
List Price:  L320.28
You save:  L91.52
Kč1,135.67
List Price:  Kč1,590.03
You save:  Kč454.36
Ft17,788.18
List Price:  Ft24,904.88
You save:  Ft7,116.69
SEK kr535.74
List Price:  SEK kr750.08
You save:  SEK kr214.33
ARS$44,071.35
List Price:  ARS$61,703.42
You save:  ARS$17,632.06
Bs343.60
List Price:  Bs481.07
You save:  Bs137.46
COP$190,320.33
List Price:  COP$266,463.69
You save:  COP$76,143.36
₡25,450.60
List Price:  ₡35,632.87
You save:  ₡10,182.27
L1,231.27
List Price:  L1,723.87
You save:  L492.60
₲372,600.80
List Price:  ₲521,670.94
You save:  ₲149,070.13
$U1,939.41
List Price:  $U2,715.34
You save:  $U775.92
zł195.86
List Price:  zł274.22
You save:  zł78.36
Already have an account? Log In

Transcript

Well guys, now we have another program to check whether a given number is a palindrome. Now, as we know, palindrome is a text or a number which is equal to its reverse. So, what we do is, of course, the first line defines about the online Python compiler. Then we have a remark saying Python program to check whether a given number is a palindrome. So, we have an input here with the message Hi, please enter a number to check for if it is a palindrome. So, the number M gets assigned in the variable temp reverse is zero as used in the last program technique.

We will take a loop by loop till the number is zero. It will approach the that is a digit, extract the digit multiply Get the reverse. So finally, we get the reverse of a number in the variable, V, and the temp variable has the original number because the written number has changed to the reverse. So we need to have this variable temp with us. And now we check whether the original number is equal to the reverse of its number. If it is, so, we use an if else statement to check if temp is equal to reverse the number is a palindrome as the number is not a palindrome.

So this is the logic of the program. We check it by running it and when we run it, we press f9 or we click on to the run. Right. And then here, we have an output, which last Hi, please enter a number to check if it is a palindrome. So let's try a number which is not a palindrome. For example, 123 we check it out, it is not a palindrome right and we press EXIT to continue.

Now, we run again we enter another number say 121 right check it is a palindrome is a balance. So, we have this small module, which talks about the important logic right. So, for to find the palindrome It is one of the very, very important programs, which is as in any programming language, so, maybe Python maybe C, maybe c++, maybe Java, maybe basic, maybe COBOL. But the logic remains same that we extract the number one by one extract the digit stole that digit in a reverse format. And this logic of extracting the digit and getting it into reverse is actually the logic which is being used in many, many programs. So, I hope the children and the guys who are taking this course should be very clear of how we are extracting the digits in this format.

Now, friends, our next program is a very, very simple program. It starts about inputting a number and printing the table of that number. So, we use it as a simple program to explain the concept of various functions statements. So, here what we do is we input a number and whose table has to be printed and then we create a range from one to 11 that means one to 10. In reality, and every time we create the value of hi from ranging from zero to 10, right, so of course one to 10 that is the first one we have taken it from one to 11 where 11 is not found today. And then we are displaying it in this form.

So let's see what we run it we do it here it says enter the number to print the table for say I write five. So, five one and accordingly we get the table. If we want to continue with of course, we can run it again with some other number. For example, we get a table right? The computation here talks about the range function, which generates numbers from one to 10. And if I make it Say for example, 13 over here, so, now the range displayed will be one to say I want to think the table eight.

So now it will be till 12 times right The difference, we thought manipulating the data. This is the sample screen, as you can see before you write, and you can even put it at a smaller phase. And this is the program which allows you to display the table of any given number in Python. So we are dealing with learning Python basics, I don't club to teach you right, the the basic level, something like making an app or something is that my objective is to make you familiar with the basic concepts of Python programming in this very format.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.