xxxxxxxxxx
for a in range(1,3):
if a%2!=0:
print(a,end=" ")
for b in range(1,a+1):
if b%5==0:
print(b,end=" ")
for c in range(a,b+1):
if c%3!=0:
print(c,end=" ")
print()
xxxxxxxxxx
def something(a):
for methodname in ['method1', 'method2', 'method3']:
try:
m = getattr(a, methodname)
except AttributeError:
pass
else:
return m()
raise AttributeError
xxxxxxxxxx
int inner;
string result = " ";
for (int outer = 0; outer < 3; outer++)
{
for (inner = 10; inner > 5; inner--)
{
result += string.Format("Outer: {0} \tInner: {1} \n\n", outer,
inner);
}
} MessageBox.Show(result);
}
xxxxxxxxxx
peoples = {
"Osama": {
"Html": "70%",
"Css": "80%",
"Js": "70%"
},
"Ahmed": {
"Html": "90%",
"Css": "80%",
"Js": "90%"
},
"Sayed": {
"Html": "70%",
"Css": "60%",
"Js": "90%"
}
}
for names in peoples :
print(f"the skill and progress for {names} is ")
for skills in peoples[names] :
print(f"{skills} => {peoples[names][skills]}")