Friday, 11 February 2022
Python practice programs for beginners - Day 15
Monday, 7 February 2022
Python practice programs for beginners - Day 11
Day 10 Solution:
Day 11: If elif
If we want to check more scenarios we can use if elif
Syntax:
if condition 1:
Statement to be executed if the condition is True
elif condition 2:
Statement to be executed if the condition is True
elif condition 3:
Statement to be executed if the condition is True
Day 11 Task: Get three numbers from the user and try to find the smallest of those three numbers.
Python practice programs for beginners - Day 10
Day 9 Solution:
Day 10: If-Else statement
In the above, we have used two if statements but we can reduce the number of lines of code by using an else statement.
You can see the number of lines of code decreased.
The If else get applied in many scenarios.
Day 10 Task:
Get a number from the user and find whether the given number is an odd number or an even number.
Python practice programs for beginners - Day9
Day 8 solution:
Python practice programs for beginners - Day8
Day 7 Solutions:
and Operator:
Example:
a=10
b=10
c=10
a==b and a==c --> True
(True) and (True) --> True
a=11
b=10
c=10
a==b and a==c --> False
(False) and (True) --> False
or Operator:
a=11
b=10
c=10
a==b and a==c --> False
(False) and (True) --> True
not Operator:
not(b==c)
not(True) --> False
Task: Try to use these operators and check various conditions.
Tuesday, 1 February 2022
Python practice programs for beginners - Day7
Try to apply the formatting to all the other arithmetic operators.
Program:
Example:
Day 7 Task:
Example:
Python practice programs for beginners - Day6
Welcome to the 30-day challenge of Python practising for beginners.
Day 5 practice program:
Practice all the Arithmetic Operators given:
Arithemtic Operators:
Program:
Day 6:
Formatting:
Syntax:
print(f'yout text {your variable}')
Example:
Python practice programs for beginners - Day5
Welcome to the 30-day challenge of Python practising for beginners.
Day 4 practice program:
The solution is similar to that of the sample program discussed.
Day 5:
Operators:
Friday, 28 January 2022
Python practice programs for beginners - Day4
Welcome to the 30-day challenge of Python practising for beginners.
Day 3 Solution:
Program:
Day 4:
Type Casting:
Practice Program Day 4:
Thursday, 27 January 2022
Python practice programs for beginners - Day3
Welcome to the 30-day challenge of Python practising for beginners.
Day 2 Solution:
Program:
Output:
Get Input from user:
So far, we have given the value to the variable in coding itself. Now we will try to get the input from the user at run time.
use input() function to get the input.
Program:
Output:
Practice program 3:
Try to use this input() to the previous program and provide the input at the run time.
--> Get the input from the user
--> Print the values
--> Print the type of variables.
Wednesday, 26 January 2022
Python practice programs for beginners - Day2
Welcome to the 30-day challenge of Python practising for beginners.
Day 1 Solution:
Python practice programs for beginners - Day2
Data types:
Practice Program - Day 2
Python practice programs for beginners - Day1
Welcome to the 30-day challenge of Python practising for beginners.
Python practice programs for beginners - Day1