https://clonerobbylab.w0w.fr

Workshop WS 1 : discovering variables

#print(“hello”)

variable=”hello”
print(variable)
print(variable+variable)
print(type(variable))
#
# variable=”6″
# print(variable)
# print(variable+variable)
# print(type(variable))

# variable=6
# print(variable)
# print(variable+variable)
# print(type(variable))
#
#
# a=input(“Enter number a please “)
# print(“the variable a is a string, not an integer, be carefull!”)
# print(type(a))
# print (a+a)
#
# #conversion
# a=int(a)
# print(type(a))
#
# print (a+a)

First program. Number comparator

a=input(“Enter number a please “)
b=input(“Enter number b please “)

print(“the variable a is “+str(a))
print(“the variable b is “+str(b))

if(a>b):
print(“a bigger than b”)
elif(a==b):
print(“numbers are equals”)
else:
print(“b bigger than a”)

Program 2. Dressing assistant

# IMPORT LIBRARYS
##################
#################################
#################################


#################################
#################################
# INIT VALUES
##################
#################################
#################################

sun=”yes”
rain=”yes”
temp=0

#################################
#################################
# FONCTIONS
##################
#################################
#################################


#################################
#################################
# STARTING MAIN CODE
##################
#################################
#################################

sun=input(“Namaste, will it be sunny today?”)
rain=input(“will it be rainy?”)
temp=input(“wich temp during the day?”)
temp=int(temp)

if (sun==”yes” and rain==”no” and temp>20):
print(“you can wear short and teeshirt”)
elif (sun==”yes” and rain==”yes” and temp>20):
print(“you can wear short and teeshirt, but mind to take an umbrella”)
elif (sun==”no” and rain==”yes” and temp>20):
print(“you should wear a jacket and an umbrella”)
else:
print(“you have to wear a paint and warm clothes”)