第五章作业

"""5.1 条件测试"""
fruit = 'apple'
print("Is fruit == 'apple'? I predict True.")
print(fruit == 'apple')


print("Is fruit == 'pear'? I predict Fsldr.")
print(fruit == 'pear')


fruit = 'banana'
print("\nIs fruit == 'banana'? I predict True.")
print(fruit == 'banana')


print("Is fruit == 'watermelon'? I predict Fsldr.")
print(fruit == 'watermelon')


animal = 'dog'
print("\nIs animal == 'dog'? I predict True.")
print(animal == 'dog')


print("Is annimal == 'duck'? I predict Fsldr.")
print(animal == 'duck')


animal = 'monkey'
print("\nIs animal == 'monkey'? I predict True.")
print(animal == 'monkey')


print("Is annimal == 'panda'? I predict Fsldr.")
print(animal == 'panda')


animal = 'ant'
print("\nIs animal == 'ant'? I predict True.")
print(animal == 'ant')


print("Is annimal == 'elephant'? I predict Fsldr.")
print(animal == 'elephant')




"""5.2 更多的条件测试"""
str1 = 'hello'
str2 = 'hi'
print("Is str1 == str2?")
print(str1 == str2)


name = 'Andy'
another_name = 'andy'
print("name == another_name?")
print(name.lower() == another_name)


print("\n2 == 2?")
print(2 == 2)
print("2 != 2?")
print(2 != 2)
print("3 > 2?")
print(3 > 2)
print("3 < 2?")
print(3 < 2)
print("3 >= 2?")
print(3 >= 2)
print("3 <= 2?")
print(3 <= 2)


number_1 = 99
number_2 = 199
if(number_1 > 50 and number_2 > 50):
print("\nTwo numbers are bigger than 50")
else:
print("\nNot all of these two numbers are bigger than 50")
if(number_1 > 100 or number_2 < 200):
print("One of numbers fix the condition.")
else:
print("Both do not fix the condition.")

animal = ['dog','duck','goose','ant']
print("\nIs ant in the list?")
print('ant' in animal)
print("Is monkey in the list?")
print('monkey' in animal)




"""5.3 外星人颜色#1"""
alien_color = 'green'
if alien_color == 'green':
print("You get 5 points.")

alien_color = 'red'
if alien_color == 'green':
print("You get 5 points.")


"""5.4 外星人颜色#2"""
alien_color = 'green'
if alien_color == 'green':
print("You get 5 points because of killing the alien.")
else:
print("You get 10 points.")

alien_color = 'red'
if alien_color == 'green':
print("You get 5 points.")
else:
print("You get 10 points.")




"""5.5 外星人颜色#3"""
alien_color = 'green'
if alien_color == 'green':
print("You get 5 points.")
elif alien_color == 'yellow':
print("You get 10 points.")
else:
print("You get 15 points.")

alien_color = 'yellow'
if alien_color == 'green':
print("You get 5 points.")
elif alien_color == 'yellow':
print("You get 10 points.")
else:
print("You get 15 points.")


alien_color = 'red'
if alien_color == 'green':
print("You get 5 points .")
elif alien_color == 'yellow':
print("You get 10 points.")
else:
print("You get 15 points.")



"""5.6 人生的不同阶段"""
age = 18
if age < 2:
print("He is a baby.")
elif age >= 2 and age < 4:
print("He is learning to walk.")
elif age >= 4 and age <13:
print("He is a child")
elif age >= 13 and age < 20:
print("He is a teenager.")
elif age >= 20 and age < 65:
print("He is an adult.")
else:
print("He is an elder.")




"""5.7 喜欢的水果"""
favorite_fruit = ['watermelon','grapes','banana','cherry']
if 'watermelon' in favorite_fruit:
print("You really like watermelon.")
if 'apple' in favorite_fruit:
print("You really like apple.")
if 'grapes' in favorite_fruit:
print("You really like grapes.")
if 'pear' in favorite_fruit:
print("You really like pear.")
if 'cherry' in favorite_fruit:
print("You really like cherry.")



"""5.8 以特殊方式跟管理员打招呼"""
user_names = ['admin','Bob','Andy','Amy','Mike']
for user in user_names:
if user == 'admin':
print("Hello admin, would you like to see a status report?")
else:
print("Hello " + user +", thank you for logging in again")




"""5.9 处理没有用户的情形"""
user_names = ['admin','Bob','Andy','Amy','Mike']
for user in user_names:
if user == 'admin':
print("Hello admin, would you like to see a status report?")
else:
print("Hello " + user +", thank you for logging in again")
user_names.clear()
if len(user_names) == 0:
print("We need to find some users!")



"""5.10 检查用户名"""
current_users = ['Jackson','Bob','Andy','Amy','Mike']
new_users = ['Bob','Lily','Susan','Andy','David']
for i in range(0,5):
current_users[i] = current_users[i].lower()
for new_user in new_users:
if new_user.lower() in current_users:
print("The name has been used. Please input another name.")
else:
print("The name has not been used.")




"""5.11 序数"""
numbers = ['1','2','3','4','5','6','7','8','9']
for number in numbers:
if number == '1':
print(number + "st")
elif number == '2':
print(number + "nd")
elif number == '3':
print(number + "rd")
else:
print(number + "th")
内容概要:该论文聚焦于6G通信中20-100GHz频段的电磁场(EMF)暴露评估问题,提出了一种基于自适应可重构架构神经网络(RAWA-NN)的预测框架。该框架通过集成权重分析模块和优化模块,能够自动优化网络超参数,显著减少训练时间。模型使用70%的前臂数据进行训练,其余数据用于测试,并用腹部和股四头肌数据验证模型泛化能力。结果显示,该模型在不同参数下的相对差异(RD)在前臂低于2.6%,其他身体部位低于9.5%,可有效预测皮肤表面的温升和吸收功率密度(APD)。此外,论文还提供了详细的代码实现,涵盖数据预处理、权重分析模块、自适应优化模块、RAWA-NN模型构建及训练评估等内容。 适合人群:从事电磁兼容性研究、6G通信技术研发以及对神经网络优化感兴趣的科研人员和工程师。 使用场景及目标:①研究6G通信中高频段电磁暴露对人体的影响;②开发更高效的电磁暴露评估工具;③优化神经网络架构以提高模型训练效率和预测精度。 其他说明:论文不仅提出了理论框架,还提供了完整的代码实现,方便读者复现实验结果。此外,论文还讨论了未来的研究方向,包括扩展到更高频段(如300GHz)的数据处理、引入强化学习优化超参数、以及实现多物理场耦合的智能电磁暴露评估系统。建议读者在实际应用中根据具体需求调整模型架构和参数,并结合真实数据进行验证。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值