1. Home
  2. /
  3. Blog
  4. /
  5. الجملة الشرطية بالبايثون
Python

الجملة الشرطية بالبايثون

September 27, 2022 1 min read 2,219
الجملة الشرطية بالبايثون

if condition :

	statement

elif condition :

	statement

else  :

	#statement





name = input("enter your name : ")

age = int(input("enter your age"))

#  ==   >   <    >=  <=  !=

# and or         &&   ||



if name == "mohammed" or name =="ahmed":

	print("hello , " , name)

	if age > 30 :

		print ("young")



elif name == "ali" and age >= 21:

	print("hello , ",name,"age : ",age)



else :

	print("wrong name")
Share:
Read next

Related articles