Categories
5G Network
Agile
Amazon EC2
Android
Angular
Ansible
Arduino
Artificial Intelligence
Augmented Reality
AWS
Azure
Big Data
Blockchain
BootStrap
Cache Teachniques
Cassandra
Commercial Insurance
C#
C++
Cloud
CD
CI
Cyber Security
Data Handling
Data using R
Data Science
DBMS
Design-Pattern
DevOps
ECMAScript
Fortify
Ethical Hacking
Framework
GIT
GIT Slack
Gradle
Hadoop
HBase
HDFS
Hibernate
Hive
HTML
Image Processing
IOT
JavaScript
Java
Jenkins
Jira
JUnit
Kibana
Linux
Machine Learning
MangoDB
MVC
NGINX
Onsen UI
Oracle
PHP
Python
QTP
R Language
Regression Analysis
React JS
Robotic
Salesforce
SAP
Selenium
Service Discovery
Service Now
SOAP UI
Spark SQL
Testing
TOGAF
Research Method
Virtual Reality
Vue.js
Home
Recent Q&A
Feedback
Ask a Question
Write a program in Python to produce Star triangle?
Home
>
Python
>
Write a program in Python to produce Star triangle?
asked
May 17, 2020
in
Python
by
sharadyadav1986
Q:
Write a program in Python to produce Star triangle?
#python-star-triangle
Answer
1
Answer
0
votes
answered
May 17, 2020
by
Robindeniel
The code to produce star triangle is as follows:
1
2
3
4
def pyfun(r):
for a in range(r):
print(' '*(r-x-1)+'*'*(2*x+1))
pyfun(9)
Output:
1
2
3
4
5
6
7
8
9
*
***
*****
*******
*********
***********
*************
***************
*****************
Click here to read more about Python
Click here to read more about Insurance
Facebook
Twitter
LinkedIn
Related questions
0
votes
Q: Write a program to display the Fibonacci sequence in Python?
asked
May 17, 2020
in
Python
by
sharadyadav1986
#python-fibonacci-sequence
0
votes
Q: Write a program to count the number of capital letters in a file?
asked
May 17, 2020
in
Python
by
sharadyadav1986
#python-program-counter
0
votes
Q: Write a program to check whether the given number is prime or not?
asked
May 17, 2020
in
Python
by
sharadyadav1986
#python-prime-number-program
0
votes
Q: What Is The Command To Debug A Python Program?
asked
Dec 22, 2019
in
Python
by
rajeshsharma
#python-debug
0
votes
Q: Write Python code to check the given sequence is a palindrome or not?
asked
May 17, 2020
in
Python
by
sharadyadav1986
#python-palindrome-program
0
votes
Q: How Do You Monitor The Code Flow Of A Program In Python?
asked
Dec 22, 2019
in
Python
by
rajeshsharma
#python-code-flow
0
votes
Q: How Do You Debug A Program In Python?
asked
Dec 22, 2019
in
Python
by
rajeshsharma
#python-debug
0
votes
Q: How do we write a function in Python Language?
asked
Aug 29, 2020
in
Python
by
Robindeniel
#python-function-write
#write-a-function
0
votes
Q: How Do You Write A Conditional Expression In Python?
asked
Dec 22, 2019
in
Python
by
rajeshsharma
#python-conditional-expression
0
votes
Q: How Do We Write A Function In Python?
asked
Dec 14, 2019
in
Python
by
sharadyadav1986
#python-write-function
0
votes
Q: How to Write a program in java to check for palindromes.
asked
Oct 24, 2020
in
JAVA
by
sharadyadav1986
#java-palindromes
#palindromes-java
0
votes
Q: Write a program in java to remove all vowels from a string.
asked
Oct 24, 2020
in
JAVA
by
sharadyadav1986
#remove-vowels-from-string
#remove-vowels-java
...