From 13a5681eac18a0055014949158aead68041bc2c3 Mon Sep 17 00:00:00 2001 From: zvevqx Date: Mon, 13 Oct 2025 09:21:50 +0200 Subject: [PATCH] first push --- 101.py | 34 ++++++++++++++++++++++++++++++++++ README.md | 0 count.py | 13 +++++++++++++ dice.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 101.py create mode 100644 README.md create mode 100644 count.py create mode 100644 dice.py diff --git a/101.py b/101.py new file mode 100644 index 0000000..faaebe1 --- /dev/null +++ b/101.py @@ -0,0 +1,34 @@ +#variables + +str string "salut" "23" ... +str(a) + +char "s" ... + +int interger -2 , 1 , 34 , 1234 ... +int(a) + +float 1.2 , 6.5 , 1/2 ... +float(a) + + +#list: +myVar = [12 , 23 , 45 , 76] + 0 1 2 3 + +myVar[1] => 23 + + +#============================================ + +print() + +import time # add lib + +for i in range(delta): + #code to execute + +input("donne un chiffre : ") + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/count.py b/count.py new file mode 100644 index 0000000..bd516fe --- /dev/null +++ b/count.py @@ -0,0 +1,13 @@ +import time + +inVal = input("how long in Minutes ? :") +inVal = int(inVal) +inVal = inVal * 60 + + +for i in range(inVal , 0 , -1): + print(i) + time.sleep(1) + +print("tadaaa") + diff --git a/dice.py b/dice.py new file mode 100644 index 0000000..75f1b27 --- /dev/null +++ b/dice.py @@ -0,0 +1,46 @@ +import random + +score1 = ["jane" , 0 ] +score2 = ["jhon" , 0 ] + +winScore = 3 + +def isWinning( score , wscore ): + if score[1] >= wscore: + print(f"THE BIG WINNER IS {score[0]}") + + + +while True: + user1Val = input("numbers 1 - 6 : ") + user1Val = int(user1Val) # convert to int + user2Val = input("numbers 1 - 6 : ") + user2Val = int(user2Val) # convert to int + + result = random.randint(1,6) # draw a number + + if user1Val == result and user2Val == result: + print("YOU BOTH WIN") + score1[1] = score1[1] + 1 + score2[1] = score2[1] + 1 + + + elif user1Val == result: # test result + print("USER 1 YOU WIN") + score1[1] = score1[1] + 1 + + elif user2Val == result: + print("USER 2 YOU WIN") + score2[1] = score2[1] + 1 + + else: + print("YOU ALL LOOOOOOSE") + print("the good value was :" + str(result)) + + isWinning(score1,winScore) + isWinning(score2,winScore) + + print(f"the scores is : {score1[0]} : {score1[1]} / {score2[0]} : {score2[1]}") + + +