Exercise 1: Capitalize my name & String concatenation | Python Tutorial #6

preview_player
Показать описание
In this video, I have explained what string concatenation in python is and how to use it to write effective python programs.
Also I have provided an exercise for your practice which I'll be solving very soon. Make sure to post your solution before I make the solution video.
Рекомендации по теме
Комментарии
Автор

str = input('Enter your name: ')

print('Your name is ' + str.upper()[0] + str[1:])
# 'str.upper()[0]' will make the first letter capitalized.
# and the "str[1:]" will print the second letter up to the last letter.

loop
Автор

# Hi I am Raj and here is the solution of the exercise
# Exercise 1
# Prettify a given name in variable "name" and print it with it's 1st character capitalized.

name = input("Enter your name : ")
print(name[0].upper() + name[1:])

# Truly appreciate your work, sir. You are a ray of light for students like us, keep up the good work and never feel demotivated

rajshah
Автор

name = "cars"
print(name.replace("c", "C"))# this function is used to change captilization of charaters

shahzarsayed
Автор

awesome teaching from ProgrammingWithHarry

lailasatriasuhaimi
Автор

Thanks, l hope this will be the another best channel in you tube

engineerbhai
Автор

name='ashok'
print (name.capitalize())
print (name[0]. upper()+name[1:5])
#for the single word title() method #also applicable
Print (name.title())

ashoka
Автор

Name='harry bhai'
Print (name[0].upper()+ name[1:])

#using concatenation

Better version will be

Print (capitalize(name))
Or
Print (name.capitalize())

gamesseries
Автор

#Exercaise 1:
# You have to prettify a given name stored in a variable "name". The output of your program must be a string
#assigning a name to variable name
name = "tacobell"
#taking the firstletter of the string
firstLetter = name[0]
#capitalizing the firstletter
firstLetter = firstLetter.upper()
#adding the first letter
print(firstLetter + name[1:])

michaelholland
Автор

Answer for Exercise 1:
name = "aryan"
print(name.capitalize())

KrEditz
Автор

# To prettify the given string
name = "swaraj"
name = name[0].upper() + name[1:]
print(name)

Swaraj_Kanse
Автор

name = "gaurav"
print(name.replace("g", "G"))

fmgaming
Автор

# Vars:
name = "m7md"

# Starting:
print(name[0].upper() + name[1:4] + ", hi harry, this is for ya!")

HiznL
Автор

nav="ciwan"
print(nav)
herf=nav[0]
print(herf)
nunav=herf.upper()+nav[1:]
print(nunav) I think this code is okey, the "print" commands between codes are for proving, :)

ferhatnusreturuc
Автор

name = "harry"
name_capitalized = name
name_capitalized = name.upper()[0:1] + name.lower()[1:6]
print(name_capitalized)

nowthatsme
Автор

good video, keep doing this
name="peter"
print("my name is

peterdendis
Автор

name="deBrup"
a=name.upper()[0]
c=name.lower()[1:]
print(a+c)

crypto_key_unlocked
Автор

# solution of 1st one
name = input()
print(name.upper(1))
#feel free to mention mistakes in it, i am just a beginner☺.

ranupandey
Автор

fresh = "harry"
print(fresh.replace('h', 'H', ))

mikegarner
Автор

name = "vishwajeet"
print(name.title())

VishwajeetGaurav
Автор

name="narendra"
>>>
>>>Narendra

narendrasinghchouhan