0% found this document useful (0 votes)
4 views2 pages

Greeting User with Name Input

Uploaded by

games001ab
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Greeting User with Name Input

Uploaded by

games001ab
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

print('hello ')

#ask name to user


name=input("what is your name ? ").strip().title()
#say helo to user
print('hello',name,'!')
print(name)
"""
hi this is another way for creating comments many line comment than
single line
"""

"""
inputs to fuctions that it can take are called parameters
but the things we pass to fuctions are called arguments
"""
print('hello,',end="")
print(name)
"""
adding quotation marks in quotations of syntax
"""
print("hello,'atharva'")
print('hello,\'atharva\'')
"""
\ stands for escaping it helps us to escape to default commands as we used
in case of end
"""
""" another way for using two diff arguments string and variable
"""
print(f"hello,{name}")
"""
formating strings
"""
"""
#remove whitespace from string

name = [Link]()

"""
#capatilizing users name(ie 1st letter)
"""
{{ name = [Link]()}} capitalizes the 1st leter of whole string ie in
atharva ahire only Atharva ahire is printed

"""
"""
#capitalizing user's name{1st letter of each word}

name= [Link]()
"""
"""
also we can just use two chain these functions together as

name = [Link]().capitilize()

"""
""" More over we can just use thses fuctions with input function itself or
the place where we defined variable named name
as name = input().strip().title()
"""
print(f'hello,{name}')
"""
these fuctions strips,capitilize,title are often refered as methods
"""

You might also like