import numpy as np
print(np.pi)
# Format output {} Represents a placeholder , The results don't show , Internal parameters can be added
print("pi value :{:.2f}".format(np.pi))
3.141592653589793
pi value :3.14
# example 2
print(" Big data technology terms :{}h and {}".format("Hadoop","Spark"))
Big data technology terms :Hadooph and Spark
# Appoint value Location
print(" Big data technology terms :{1} and {0}".format("Hadoop","Spark"))
Big data technology terms :Spark and Hadoop
# Appoint value Specific value
print(" Website name :{name}, website :{site}".format(name="Python",site="www.pyhton.org"))
Website name :Python, website :www.pyhton.org
1. All lowercase 、 All caps and initials are right name Format the output .
name=input()
print(name.lower())
print(name.upper())
print(name.title())
Input : niuNiu
Output :
niuniu
NIUNIU
Niuniu
2. Suppose the input is name by Niuniu, The output I am Niuniu and I am studying Python in Nowcoder! Please output the corresponding English sentence according to the above sentence pattern .
name=input()
print('I am {0} and I am studying Python in Nowcoder!'.format(name))
Input :
Niuniu
Output :
I am Niuniu and I am studying Python in Nowcoder!
3. Go to space :
Input description :
One string per line represents the name name( notes :name With some extra white space on both sides ).
Output description :
One line output name The original content after removing the blank characters on both sides .
name = input()
print(name.strip())
Input :
Niuniu
Output :
Niuniu