Program Note:
Heads up, friends!
The question mentioned earlier includes the use offorandwhileloops — concepts we’re just about to explore in today’s blog.
But don’t worry! By the end of this post, you’ll understand loops well enough to solve it confidently.
Also, I’ll update the previous blog to better fit the learning flow — thanks for your patience and sorry for the inconvenience!
For Loop:
Example: for i in range(5):
print(i)
Now let us talk about the while loop
While Loop:
while count <= 5:
print(count)
count += 1
54321
4321
321
21
1
Ordinary number: Every ASCII Codes Like "A","B"etc are know as Ordinary number. Each ASCII codes have the unique ordinary number.
pattern:
EDCBA
EDCB
EDC
ED
E
Split(): This function is applicable to String datatype and this function break the string and store each word in the list.
Append(): This function is used to add one list, string, number etc in the defined string. In this string you can only pass one argument
Q1. Print the following pattern:
FGHIJ
GHIJ
HIJ
IJ
JQ2. Print the following pattern:
54321
4321
321
21
1Q3. Print the following pattern:
54321
4321
321
21
1Q4. Print the following pattern:
1
12
123
1234
12345Q5. Print the following pattern:
1
21
321
4321
54321Q6. Print the following pattern:
7. Write the following pattern:
EDCBA
DCBA
CBA
BA
A8. Write the following pattern:
E
DE
CDE
BCDE
ABCDE9. Write the following pattern:
A
BA
CBA
DCBA
EDCBA10. Write the following pattern:
ABCDE
BCDE
CDE
DE
ENow take some more questions.
Question11: Write the code to print the first n prime number.Question12: Write the programme to print the fibonacci Series.Question13: Write the programme to print the Geometric progression.Question14: Write the programme to print that the string entered by the user is palindrome or not.
Now Lets discuss the Homework Question of the previous Blog and I will provide for question regarding the pattern and Loops.
Question2: Suppose your father is the head of the labour factory and He wants to sort the name of the labour on the basis of their wadges. Wether they are rich or poor. So, write the programme to help him. Programme:wadge=int(input("enter the wadge of the worker"))if wadge>=1000: print("The worker is rich!!")else: print("the worker is not rich!!")
Question3: Suppose you are Reema head Girl of the class and your class teacher asked you to sort the student in the category of height as shortest , short , tall and tallest. So, create a programme for helping your teacher to short the students.
Programme:
✅ Conclusion
👉 If you’re still building your foundation, you can first check my previous blog on Python Basics – A Beginner's Guide 🐍, which covers all the basic concepts step-by-step.
In the upcoming blogs, we’ll continue learning more exciting topics in Python, so stay tuned and keep coding consistently. 💻✨
Thank you!!!



2 Comments
Good coding k eep it up beta
ReplyDeleteGood job
ReplyDelete