Below is the program to generate the following pattern.

Python program to generate patterns
n=int(input("Enter the number :"))
k=1
for i in range(1,n+1):            # outer loop
  for j in range(1,i+1):          # inner loop
    print(str(k)+" ",end="")
    k=k+1
  print("\r")   
   

Python program to generate patterns

Output:

Python program to generate patterns

Explore More

Explain about Hugging Face Transformers

Hugging Face Transformers is a powerful library designed for natural language processing (NLP), computer vision, and audio tasks. It provides state-of-the-art pretrained models and tools for fine-tuning and deploying these

AI Roadmap using Python

Python is a great foundation for diving into AI! To take the next step in your AI learning journey, here’s a roadmap to guide you. 1. Strengthen Your Math Skills

What are Large Language Models

LLM stands for Large Language Model in the context of artificial intelligence. It refers to a type of AI model designed to understand, generate, and manipulate human language on a