User-Defined-Functions

Wed 12 November 2025
#  created : 20250321
#  https://www.scientecheasy.com/2022/12/user-defined-functions-in-python.html/
# Syntax of User defined Function
# def function_name(parameter_list): # function header
#     . . . . . .
#     body_of_the_function
#     . . . . . .
#     return <value(s)>
# user defined function definition
def greeting():
    print('Hello world!')
    print('Welcome to the world of the programming!')
# Function calling.
greeting()
Hello world!
Welcome to the world …

Category: python-basics

Read More

Username

Wed 12 November 2025
import re
def valid_username(username):
    if username[0].isdigit():
        return False
    if len(username) > 15:
        return False
    return True

usernames_input = input("Enter usernames separated by commas: ")

usernames = usernames_input.split(',')

for username in usernames:
    username = username.strip()  
    print(f"Username: {username} -> Valid")
Enter usernames separated by commas:  jerin,dass


Username: jerin …

Category: python-basics

Read More

Variables-Python

Wed 12 November 2025
#  created : 20250112
#  https://www.scientecheasy.com/2022/09/variables-in-python.html/
#  variables in pyhton 
num = 20
print(id(num))
8910408
x = 20 
y = 50
z = 100
print(x);print(y);print(z)
20
50
100
phy = 89
chem = 86
maths = 90

marks_obtained = phy + chem + maths

mark = (marks_obtained * 100) / 300
print(mark …

Category: python-basics

Read More

Vowels-Str

Wed 12 November 2025

def count_vowels(s):
    vowels = "aeiouAEIOU"
    count = 0
    i = 0
    while i < len(s):
        if s[i] in vowels:
            count += 1
        i += 1
    print("Number of vowels:", count)

# Example usage
count_vowels("hello world")
Number of vowels: 3


Score: 0

Category: python-basics

Read More

While-Loop

Wed 12 November 2025
#  created : 20250125
#  https://www.scientecheasy.com/2022/10/while-loop-in-python.html/
count = 0
# Declare the while loop statement.
# Loop continuation condition expression that must ends with a colon (:).
while count < 5:
# Body of the loop.
    print('Hello Python') # This statement will execute as long as the condition is true.
    count += 1 …

Category: python-basics

Read More

Zzemp

Wed 12 November 2025
# Created: 20250104
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: py311; pyv: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0]'
print(pyu.ps2("requests"))
requests==2.32.3


Score: 0

Category: stockmarket

Read More
Page 10 of 10

« Prev