Write a Python program to calculate the length of a string,

# Python program to calculate the length of a string.

def string_length(str1):

count = 0

for char in str1:

count += 1

return count

print(string_length(‘Python Program’))

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Rubber Ducking A Mentor

gRPC load balancing on Kubernetes (using Headless Service)

3 Simple Steps To Write Beautiful & Better Code

Touchpad problem with Asus laptop on Linux

JUICE OF THE QUARTER — Q1 2022

CS 373 Fall 2021 Week 3: Lauren Warhola

Why Laravel is a great framework to work with?

How To Be a Developer That People Want on Their Team

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Globalranker

Globalranker

More from Medium

66 Days of Data Science — Day 7

Elevate your spaces with the help of carpets

Knapsack Problem

How my practicum project prepared me for being a professional in data analytics