This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nums = [ | |
12, 45, 23, 67, 34, 89, 22, 90, 56, 78, | |
101, 5, 48, 92, 33, 77, 505, 64, 29, 87, 19, | |
120, 44, 58, 39, 73, 11, 84, 65, 95, 60, | |
13, 102, 150, 99, 88, 215, 299, 201, 158, 506 | |
] | |
n = nums[0] | |
while len(nums) > 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_feedback = [ | |
"user123|rating:4|comment:Good service", | |
"user456|rating:N/A|comment:Late delivery", | |
"user789|rating:5|comment:Excellent!", | |
"user321|rating:2|comment:Bad packaging", | |
"user654|rating:ERROR|comment:--", | |
"user987|rating:3|comment:Average experience", | |
"user112|rating:5|comment:Quick delivery", | |
"user198|rating:1|comment:Very poor support", | |
"user345|rating:INVALID|comment:No response", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log_data = [ | |
"door,open,10:30", | |
"window,open,10:31", | |
"door,open,10:45", | |
"light,ON,10:32", | |
"door,close,11:40", | |
"light,OFF,16:32", | |
"light,Malfunctioned,16:35", | |
"door,open,21:35", | |
"door,open,10:30", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log_data = [ | |
"door,open,10:30", | |
"window,open,10:31", | |
"door,open,10:45", | |
"light,ON,10:32", | |
"door,close,11:40", | |
"light,OFF,16:32", | |
"light,Malfunctioned,16:35", | |
"door,open,21:35", | |
"door,open,10:30", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#write a program to take input age from user: | |
# | |
# # we are using here _ , throwable variable ( placeholder variable) | |
try: | |
for _ in range(3): | |
a = input("Enter the age : ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
temperatures = [] | |
# > 60 is cold , < 60 >75 is comfortable , <75 is hot | |
try: | |
for _ in range(3): | |
# try: | |
t = input("Input temperature : ") | |
t = int(t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_numbers = [] | |
try: | |
for i in range(5): | |
try: | |
n = int(input("Enter a number: ")) | |
my_numbers.append(n) | |
except ValueError: | |
print("Invalid input, try again") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fruits = ["apple", "banana", "grapes", "pineapple"] | |
query = input("Ener any fruit name : ") | |
# this is global variable | |
# means, it is available for any code in this file | |
available = False | |
counter = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=10 | |
b=30 | |
print("Product of " + repr(a)+" and "+repr(b)+" is "+repr(a*b)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
temp = 37 | |
temp_d = 40 | |
print("Current temperature is :", temp) | |
print("Max temp allowed is :", temp_d) |