Thursday 17 February 2022

Python practice programs for beginners - Day 19

1 comment :

 

Python practice programs for beginners - millioninformations

Day 18: Solution




Day 19: Getting list items from users at run time and printing it.



You can practice the above program.

Day 19 Task: Get the Hollywood movie list going to get released in 2022 Summer from the user and print it.




Read More

Python practice programs for beginners - Day 18

1 comment :

Python practice programs for beginners - millioninformations

 Day 17 Solution:



Day 18: Introduction to List

A list is a collection of items. The items can be of any type.

Example: [1,2,3,5.5,"a",True]

How to print a list in Python?

Output: 

[1, 2, 3, 4, 5.5, True]


But if we want to print the list items alone we need to use for loop.



Output:

1

2

3

4

5.5

True


Day 18 Task: Create a list for latest gadgets and display it.





Read More

Monday 14 February 2022

Python practice programs for beginners - Day 17

1 comment :

 

Python practice programs for beginners - 17

Day 16: Solution

Python Multiplication table program

Output:

Python Multiplication table program


Day 17: While loop

Syntax:

while condition to check:

    statement to be executed

Example: 

   



Day 17 Task: 

Get a number from the user and print the odd numbers in that range.





Read More

Saturday 12 February 2022

Python practice programs for beginners - Day 16

1 comment :

 

Python practice programs for beginners - Millioninformations

Day 15 Solution:


Output:

for loop even number


Day 16: For Loop

Mini Project 2:

Get a number from the user and display the multiplication table of that number. You can also get them up to which number you can display the table.



Read More

Friday 11 February 2022

Python practice programs for beginners - Day 15

1 comment :

 

Python practice programs for beginners - Day 15


Day 14 Solution:


Output:

Day 15 : for loop

If you see in the above picture the output is starting from 0 and ending with 9. If we want to start from 1 to 10 then we need to change the code in the range.


In this we have to use from 1 to 11 (10+1) because the loop runs from 1 to whatever the value mentioned at end position -1.

Output:

Day 15 Task: 

Get start value and end value from the user at run time and print all the even numbers between that range.


Read More

Thursday 10 February 2022

Python practice programs for beginners - Day 14

1 comment :

 

Python practice programs for beginners - Day 14


Day 13 Solution:

Python Grade Checker Project Source Code:

Download Source code


Day 14: for loop

Syntax: 

for val in sequence:

    statements to be expected in the loop

val - variables

sequence - may be a range or list of items

Example:

Output:


Task: Print your name 10 times






Read More

Wednesday 9 February 2022

Python practice programs for beginners - Day 13

1 comment :

Python practice programs for beginners - millioninformations

 
Welcome to Day 13 of the 30 days Challenge.

Day 12 Solution:


Day 13: 

So far we have practised on

1. Variables
2. Operators
3. Control statements
4. String formatting

with the help of all these try to do the below task:

Project 1: Grade Checker Project

Get a student details such as:

Name:

School/College:

City:

Subject 1 mark :

to

Subject 5 mark:

Then calculate the following details and display them:

Total:

Average:

Pass/Fail:

Grade:

Grade Calculation based on Average value:

91 to 100 - A+

86 - 90 - A

80 - 85 - B+

79 - 84 - B

70 - 78 - C

60 - 69 - D

50 - 58 - E

Below 50 - F

Sample Output:

Python - grade checker program

Will see the solution in the next post.


Read More

Tuesday 8 February 2022

Python practice programs for beginners - Day 12

1 comment :

 

Python practice programs for beginners - millioninformations


Day 11 solution:


Output:


Day 12: String Format

In the above program instead of using 

print(number3," is the greatest number")

We can use 

 print(f'{number3} is the greatest number')

f --> format

' --> single apostrophe used to say that it follows String formatting. 

{} -->  we can use the curly braces for the placeholders where we can mention the variable name.

Task:

Try to reprogram the above logic using String formatting.




Read More

Monday 7 February 2022

Python practice programs for beginners - Day 11

3 comments :

 

Python practice programs for beginners - millioninformations


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.



Read More

Python practice programs for beginners - Day 10

2 comments :

 

Python practice programs for beginners- millioninformations


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.


Read More