<jupyter_start><jupyter_text><jupyter_code>ROOT="/content/drive/MyDrive/Python_Assignments/Assignment-2"
import os
os.chdir(ROOT)
assert ROOT == os.getcwd()
os.getcwd()
with open("test.txt", "w") as f:
  f.writelines("hello colab")<jupyter_output><empty_output><jupyter_text>Assignment-2<jupyter_code>""" Create the below pattern using nested for loop in Python
 *
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
"""
num=int(input("enter a number :"))
for i in range(1,num+1):
  print(""*(num-i),end=" ")
  for j in range(1,i+1):
    print("*",end=" ")
  print()
for p in range(1,num):
  print(""*p,end=" ")
  for q in range(1,num+1-p):
    print("*",end=" ")
  print()<jupyter_output>enter a number :5
 * 
 * * 
 * * * 
 * * * * 
 * * * * * 
 * * * * 
 * * * 
 * * 
 *<jupyter_text>2.Write a Python program to reverse a word after accepting the input from the user.Input word: ineuronOutput: norueni<jupyter_code>Input=input("enter the string :")
Input[::-1]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20424671385237614, 'fraction_numerical': 0.012133468149646108, 'mean_word_length': 4.26595744680851, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '393417', 'license': 'MIT', 'n_tokens_mistral': 413, 'n_tokens_neox': 404, 'n_words': 74, 'path': 'Assignment_2.ipynb', 'repo_name': 'Praveenku32k/Python_40_works_day_to_day', 'size': '989'}