Computer Science, asked by ElegantMermaid, 1 month ago

Write A Program to print this pattern in Python:
*
* *
* * *
* * * *
* * * * *
print (“*”, end = “ “)
# ending row
print (‘\r’)



DON’T SPAM ❌❌

Answers

Answered by Anonymous
6

ᴘᴀᴛᴛᴇʀɴs ᴄᴀɴ ʙᴇ ᴘʀɪɴᴛᴇᴅ ɪɴ ᴘʏᴛʜᴏɴ ᴜsɪɴɢ sɪᴍᴘʟᴇ ғᴏʀ ʟᴏᴏᴘs. ғɪʀsᴛ ᴏᴜᴛᴇʀ ʟᴏᴏᴘ ɪs ᴜsᴇᴅ ᴛᴏ ʜᴀɴᴅʟᴇ ɴᴜᴍʙᴇʀ ᴏғ ʀᴏᴡs ᴀɴᴅ ɪɴɴᴇʀ ɴᴇsᴛᴇᴅ ʟᴏᴏᴘ ɪs ᴜsᴇᴅ ᴛᴏ ʜᴀɴᴅʟᴇ ᴛʜᴇ ɴᴜᴍʙᴇʀ ᴏғ ᴄᴏʟᴜᴍɴs. ᴍᴀɴɪᴘᴜʟᴀᴛɪɴɢ ᴛʜᴇ ᴘʀɪɴᴛ sᴛᴀᴛᴇᴍᴇɴᴛs, ᴅɪғғᴇʀᴇɴᴛ ɴᴜᴍʙᴇʀ ᴘᴀᴛᴛᴇʀɴs, ᴀʟᴘʜᴀʙᴇᴛ ᴘᴀᴛᴛᴇʀɴs ᴏʀ sᴛᴀʀ ᴘᴀᴛᴛᴇʀɴs ᴄᴀɴ ʙᴇ ᴘʀɪɴᴛᴇᴅ. 

sᴏᴍᴇ ᴏғ ᴛʜᴇ ᴘᴀᴛᴛᴇʀɴs ᴀʀᴇ sʜᴏᴡɴ ɪɴ ᴛʜɪs ᴀʀᴛɪᴄʟᴇ. 

sɪᴍᴘʟᴇ ᴘʏʀᴀᴍɪᴅ ᴘᴀᴛᴛᴇʀɴ 

ᴘʏᴛʜᴏɴ3

# ᴘʏᴛʜᴏɴ 3.x ᴄᴏᴅᴇ ᴛᴏ ᴅᴇᴍᴏɴsᴛʀᴀᴛᴇ sᴛᴀʀ ᴘᴀᴛᴛᴇʀɴ

 

# ғᴜɴᴄᴛɪᴏɴ ᴛᴏ ᴅᴇᴍᴏɴsᴛʀᴀᴛᴇ ᴘʀɪɴᴛɪɴɢ ᴘᴀᴛᴛᴇʀɴ

ᴅᴇғ ᴘʏᴘᴀʀᴛ(ɴ):

     

    # ᴏᴜᴛᴇʀ ʟᴏᴏᴘ ᴛᴏ ʜᴀɴᴅʟᴇ ɴᴜᴍʙᴇʀ ᴏғ ʀᴏᴡs

    # ɴ ɪɴ ᴛʜɪs ᴄᴀsᴇ

    ғᴏʀ ɪ ɪɴ ʀᴀɴɢᴇ(0, ɴ):

     

        # ɪɴɴᴇʀ ʟᴏᴏᴘ ᴛᴏ ʜᴀɴᴅʟᴇ ɴᴜᴍʙᴇʀ ᴏғ ᴄᴏʟᴜᴍɴs

Similar questions