install python from official website- Link
best way is to save file in a folder "mypgms" and execute in the same location # mypgms can be like ramu123, harsha, guru, ....
Example#1:
download Anaconda from official website:
https://repo.anaconda.com/archive/Anaconda3-2025.06-0-Windows-x86_64.exe
print('This is krishnasbodh.com')
data = input()
in step2, we can not know that the prompt is asking us to give input value either text/number/name/... any field value.
data= input('Enter your name: ')
n=int(input('enter n value: '))
fact=1
for i in range (2,n+1):
fact=fact*i
print('factorial of n is: ',fact)
a=input('enter name1: ')
b=input('enter name2: ')
c=input('enter name3: ')
d=a+b+c
print(d)
print(a,b,c,sep=', ')
def fac(n):
res=1
for i in range (1, n+1):
res=res*i
return res
n=int(input('enter an integer: '))
print('factorial of given number is ',fac(n))
import re
def detect_voice(sentence):
# Look for 'be' verb + past participle + 'by'
# Handles: "apple was eaten by me", "apples are cooked by her", etc.
passive_pattern = r"\b(is|am|are|was|were|be|been|being)\b\s+\w+(ed|en|t)\b.*\bby\b"
if re.search(passive_pattern, sentence.lower()):
return "Passive Voice"
else:
return "Active Voice"
sentence = input("Enter a sentence: ")
print(detect_voice(sentence))