Monday, 7 February 2022
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
Variables:
Rules for declaring Variables:
Practice Program - Day 1
Sample output:
Tuesday, 25 January 2022
How to run Python program
30 Days Python Practice Challenge for Beginners.
Python is the most powerful but simple programming language right now.
This Python practice program for beginners will help you to get confidence in the basics of Python programming.
Since we need to use Python you may also download Python or also can use online python compilers. For mobile users download the Pydroid 3 app or QPython 3L.
Method 1: Using IDLE in Laptop (Once Python Installed)
Once you have installed Python, let's open idle.
You can search IDLE in the windows search bar.
You can something like this once opened.
Click on File --> New File
You will get a file like this. In this, you can start practising the program.Once you typed it, you can save it and run the program by clicking Run option.