Tumgik
#b side2
newxdiary · 5 months
Text
December 6, 2023
Coffee Time: 7:32 p.m.
The Cure, THREE IMAGINARY BOYS (SIDE2)
Rosemary Clooney, FOR THE DURATION
I’ve got rent covered, and my SNAP benefits come available at 5 a.m. tomorrow. We’re in the midst of a rainy period. The Weather Bureau refers to is as an “atmospheric river.” Such a stupid term. Innovation in so many ways is overrated. Rain like this is nothing new, just the terminology is. We are in the age of insufferable twats.
WE ARE IN THE AGE OF INSUFFERABLE TWATS!
I may be verging on self-destructive behavior, socially speaking. Nothing violent, just me destroying myself with the things I say out loud and online. The point isn’t to self-immolate, but to contribute my point of view. I don’t know if I’m right, but I feel like I am. I don’t like the way people think, and I don’t want to keep that quiet.
Fundamentalism noun fun·da·men·tal·ism ˌfən-də-ˈmen-tə-ˌli-zəm
1 A. often capitalized : a movement in 20th century Protestantism emphasizing the literally interpreted Bible as fundamental to Christian life and teaching B. the beliefs of this movement C.adherence to such beliefs a minister noted for his strict fundamentalism
2 a movement or attitude stressing strict and literal adherence to a set of basic principles Islamic fundamentalism political fundamentalism fundamentalist ˌfən-də-ˈmen-tə-list noun fundamentalist adjective or fundamentalistic ˌfən-də-ˌmen-tə-ˈli-stik
...And of course, the significance of this is that progressives on the left have been creating an ad-hoc type of fundamentalism that structures progressive principles in a dogmatic fashion that is every bit as obnoxious and restrictive as and form of religious fundamentalism. They’re too stupid to figure out that it’s just as bad.
Today on THREADS, the social media app that is competing with the failing “x” (formerly twitter) some dumb ass photographer posted a theory that street photography shouldn’t be practiced because it exploits the homeless. This generation of Moral Busy Bees needs to have their socks stuffed in their mouths. Street photography involves taking candid shots very often. Only a total jack ass would suggest restricting it. For the record I take many photographs of the homeless.
I shall be the heretic I was always meant to be.
0 notes
thyele · 1 year
Text
2023年5月12日
Large House Satisfactionさん「【久々の神戸!】 JOKER!!!!!! チケット発売開始!!!!!! https://t.co/fmQImX1HqS Large House Satisfaction 首振りDOLLS and more... ※取り置き予約あり ※入場順:イープラス→取り置き予約 https://t.co/svzGS4TTRX」https://twitter.com/largehouse/status/1656267384251092993
赤いくらげさん「【明日コレだ📡))))👀👂💥】 5/11(木)下北沢CLUB Que ◼️HERE ◼️首振りDolls ◼️赤いくらげ  open18:15/start 19:00 前売3,500/当日3,800+1D 配信2,500 🙉💣{赤いくらげ19:00~爆音))) ▼チケット予約🎫 https://t.co/DgiBnWA3JN ▼配信もあるよ🖤🖤 https://t.co/QrkQFYjMuw https://t.co/SuKhr5etkB」https://twitter.com/akaikurage_/status/1656262962418700288
魚住 英里奈(official)さん「🟦熊本公演2日目 5.13 (土) ENDELEA COFFEE京町 OPEN 18:00 / START 18:15 / END 19:30 Y2,000 + 1DRINK ORDER *student Y500 off 出演: 魚住英里奈 予約・問い合わせ: 080-1724-6624 [email protected] https://t.co/gEuewxXgDn」https://twitter.com/uozumi_chas/status/1656288567730278400
DEATHROさん「📢New Release 2023/5/20レコードリリース 2023/6/7配信開始 #DEATHRO 『ときめき』 Royal Shadow/RS-26/7'EP/¥1,100 Side1: ときめき Side2: NO HYPER DEATHRO初となる7インチシングル盤をドロップします! 溝が擦りきれるまで聴いて下さい 試聴TRAILER↓ https://t.co/1FKgcmQsT3 https://t.co/ZdrPhDZDby」https://twitter.com/deathro_com/status/1656268147614453760
☕️ふなもと健祐🥁さん「先日の優多歌さんのバンドライブ動画です! なかなかにブルータルな演奏になってます🥁🎸🎙️ ぜひ観てください!! 2023/5/9目黒碑文谷アピア40ライブ優多歌+山崎怠雅+ふなもと健祐 https://t.co/9b7QQa4e4H @YouTubeより」https://twitter.com/funamoch1/status/1656289775224254466
猫好きYOU_THE SOUND BEE HD☠️MARY RUE☠️Lemさん「アメブロを投稿しました。 『あ、忘れてた』 #アメブロ #猫好き https://t.co/jwyr4g73rV」https://twitter.com/YOUsoundbee/status/1656291176218243072
清春さん「清春 live2023『alive』 5.07 kashiwa palooza 撮影 森好弘 #辻コースケ #栗原健 #畑崎大樹 #清春 #live #alive https://t.co/pCQrtiBSnl」https://twitter.com/ki_spring/status/1656291791103201280
こびー(奏音)さん「チケット発売開始しました🎟 皆様お早めにお求めを🎶」https://twitter.com/canon_ohuton/status/1656256423062560769
横山企画室さん「誘って頂きありがとうございます^^/ ガッツリ出して頂きありがとうございます♪ ガンガンにブッ飛ばして下さい^^b 皆さんヨロシクお願いします♪」https://twitter.com/yokodile01/status/1656303244216500226
nao 首振りDollsさん「楽しかったあのやつ。読んでねっ」https://twitter.com/kubihuri_nao/status/1656303372448968705
₩ТЯさん「◯天楼様上洛 https://t.co/rsUUXSQrcP」https://twitter.com/dqr_v/status/1655986749657735168
lucy+peter=esolagoto / 中村真悟さん「いよいよ明日は「とろりんぽ」。 3manで時間長め、ディープなリストで臨みます。 愉しみです😍😍😍」https://twitter.com/lucy_peter/status/1656305883914313731
横山企画室さん「M14の正体がわかりました^^ 2023年創作早見表 https://t.co/4dBQidd6DZ #defspiral」https://twitter.com/yokodile01/status/1656309831970721792
Deshabillz2023 8月19日(土)心斎橋SHOVELさん「#新しいプロフィール画像 https://t.co/ARXhssNq88」https://twitter.com/Deshabillz2022/status/1655701690992185345
Jさん「最高でした!!!!🔥🔥🔥🔥🔥🔥🔥🔥😉」https://twitter.com/J_wumf/status/1656322775039242240
KINGRYOさん「水曜日の歌キャス ちょい空いたのでほんのり緊張してましたが結果とっても楽しかったです🦁✨ 皆様ご視聴ありがとうございました♪ https://t.co/Q92Dedtbpm」https://twitter.com/kingryoworld/status/1656325245467525120
マリアンヌ東雲🌹キノコホテル総支配人さん「🌹🌹マリアンヌの教典🌹🌹 発売決定致しました。 まあ色々あったけど、底力出してみたわ👠 全ては、今後のキノコホテルを支えてくれる皆んなの為に。 もう9枚目だなんてゾッとしますけど、ひとつ宜しく頼むわね。 キネマ倶楽部の10日前に発売なので、ボーッとしてちゃ駄目よ🐼 #キノコホテル営業再開 https://t.co/Txkkt8Sln9」https://twitter.com/marianne_sama/status/1656246259945177088
こもだまり|昭和精吾事務所さん「昭和精吾事務所のリオフェス参加映像「糸地獄」にご出演いただく女優・大島朋恵さん(りくろあれ主宰)の舞台、本日5/11と12の二日間! 廻天百眼で何度も共演している伊勢参さん所属の偉伝或~IDEAL~公演です。 偉伝或さん、殺陣公演は見てるんですが 物語あるのはまだ拝見してないので行きたいよね…」https://twitter.com/mari_air/status/1656372467534041088
Ryuichi Kawamura officialさん「余震に気をつけましょう🫶🏻 https://t.co/ODCKDITL2B」https://twitter.com/RyuichiKawamur2/status/1656434987535835137
猫好きYOU_THE SOUND BEE HD☠️MARY RUE☠️Lemさん「アメブロを投稿しました。 『地震警報が1番ビビる💦』 #アメブロ #猫好き#ねこ https://t.co/IiKD6ikFLV」https://twitter.com/YOUsoundbee/status/1656437221455704066
Ryuichi Kawamura officialさん「今夜19時〜RKS🫶🏻 https://t.co/LBhWktZXcn」https://twitter.com/RyuichiKawamur2/status/1656442544627265536
アベシーさん「そして5/16(火)はshowboat よろしくお願いします🎵」https://twitter.com/VZl7rbtXjtKOHlD/status/1656444229663748097
森 翼Tsubasa Mori/MIMIZUQさん「昨日は撮影。今日はレコーディング。約2ヶ月後にはまたタイで生活。拠点を増やす。行き来の生活。人生が2つに分かれたような、寿命が半分になったようなそんな時間の使い方。会いたい人に会いに行くし、歌いたいとこに歌いに行く。って考えてたら警報アラーム。こわかったな。地震大丈夫やった?おはよ https://t.co/534MzYv6Wz」https://twitter.com/mori_tsubasa/status/1656454201998995456
首振りDollsさん「昨日連絡がありまして更に一週間延長になりました🥹🙌 5/18(木)まで毎日18:15〜放映中!」https://twitter.com/KubihuriDolls/status/1656472700649615360
The Brow Beat Officialさん「【LIVE】 The Brow Beat Live Tour 2023 "The Five Senses” 7大都市14公演 2公演目 5月10日(水) CLUB CITTA' 川崎にご来場の皆さま 配信をご視聴の皆さま ありがとうございました。 【配信】アーカイブ6日間 https://t.co/AUlLjCI5SW 次回、 5月13日(土) なんばHatch 開場17:00/開演18:00… https://t.co/vJt2LfBc2q」https://twitter.com/The_Brow_Beat/status/1656472422223343616
烏羽玉 能 meets COFFEEさん「【烏羽玉 能 meets COFFEE】イベントでは、能の演目に合わせた珈琲豆をイベントのために開発、焙煎し、お客様に提供と販売を行っています。 今回(5/7)では、演目『杜若』にちなみ、歌人・在原業平をイメージした珈琲豆を作りました。 今後のイベントでもテーマに沿った珈琲を開発していきます! https://t.co/EG67ISYYnn」https://twitter.com/UbatamaNmC/status/1656476036610265088
☕️ふなもと健祐🥁さん「開発していきます! 次の回からは豆の講評プリントアウトして配布しよっと。」https://twitter.com/funamoch1/status/1656477751623417857
金髪豚野郎K助(偽殿下)さん「今日も良い天気だと 張り切って半袖で原チャで来たらまだちょっと寒かった (°_°) #ヨシダ楽器 https://t.co/iHMI0Isww3」https://twitter.com/goldenpigdrumer/status/1656482009605349376
首振りDollsさん「📢本日!! ▷▷2023/05/11(木) 下北沢CLUB Que 『HERE, 首振りDolls, 赤いくらげ』 OPEN 18:15 / START 19:00 ・HERE ・首振りDolls ・赤いくらげ 🎫当日券有り 🎥配信もあります! https://t.co/VhGAmBFggM https://t.co/GI8hY9M9JQ」https://twitter.com/KubihuriDolls/status/1656484960843501572
nao 首振りDollsさん「なんてこったい!!」https://twitter.com/kubihuri_nao/status/1656495124459958272
【Phobia】 KISUIさん「Phobia/abyssの集い https://t.co/fkCgm8Wg9b」https://twitter.com/KISUIxxx/status/1656495890826399746
seekさん「本日20時スタート🐈 MIMIZUQ4人揃っておしゃべりしています。 是非ご覧ください。 ニコニコ生放送 KSPチャンネル『WACHA★WACHA』 2023年5月11日(木) 20:00-21:00生放送 URL → https://t.co/SzxkED3co5 番組twitter→ @WACHA_KSP https://t.co/pctDpGYi3D」https://twitter.com/seek_bonshisya/status/1656498947593236480
KING OFFICIALさん「【TOMORROW】 2023.5.12(金)高田馬場CLUB PHASE 「狂い咲きの蕾」 出演者 Gargoyle / KING / UCHUSENTAI:NOIZ   ■入場チケット 一般受付中 (先行・一般共通) https://t.co/7MH1eOQmtt   ■配信チケット https://t.co/fH1GP2QwEM   [入場順] ①先行A1〜 ②一般B1〜 ③当日券 https://t.co/5639yjhGYw」https://twitter.com/KINGOFFICIAL114/status/1656500854000881664
孤独な陽カラス@渋谷愛8・土曜担当さん「カァ~ ちょ お知らせ。 #渋谷愛ビジョン では、毎時00~20分にスペシャルMVが放映されてるんだけどぉ~ 毎週金曜が、コンテンツ更新日。 今日まで放映のモノの中で1週間延長決定したMVが複数あるんで、いくつかご案内! 🕙10:00~10:05,16:00~16:05 #荒井まい @mai1005arai さん 🕕18:15~18:20…」https://twitter.com/KodokuKarasu/status/1656515334160130049
こびー(奏音)さん「昨日から発売のコチラのチケット皆様ゲットして頂いたでしょうか‼️ 神戸でこの対バンはきっと特別な夜になるはず🌟 皆様お待ちしてます🫶🏻☺︎ 6月24日(土) 「JOKER」 ▫️ Large House Satisfaction ▫️首振りDolls and more... ⏰17:30/18:00 🎟前売¥3,000/当日¥3,500 (1D別) https://t.co/PPNhKmE3Di https://t.co/LrTMhmifM1」https://twitter.com/canon_ohuton/status/1656504949495443456
seekさん「MIMIZUQさん。 レコーディングスタート。 パクッ♪ https://t.co/5qk5hsVkDA」https://twitter.com/seek_bonshisya/status/1656521914091995138
Jさん「あらためて、昨日は本当に最高な夜でした!ニューロティカのメンバーの皆さん、ロフトのスタッフの皆さん、集まってくれた仲間たち、観に来てくれた最高なみんな!に心から感謝!!!みんなでまた、でっかい波に乗りましょう!!!!😉✌️ #ニューロティカ #ビッグウェンズデー #新宿ロフト #wumf #J」https://twitter.com/J_wumf/status/1656524313602957312
小美玉たかしさん「本日、このあと遂に超大物から超絶大切なお知らせがあります† 震えて待て…† #小美玉たかし #情報解禁 https://t.co/W4yW7VgLke」https://twitter.com/TAKASHI_OMITAMA/status/1656527210734579712
nao 首振りDollsさん「今日下北。 下北系とされる方々が間違って入ってきても夢中にさせる何かがあります。 首振りDollsにはね!!」https://twitter.com/kubihuri_nao/status/1656528137495392257
武田将幸 HEREさん「本日は下北沢CLUB Queにて首振りDolls、赤いくらげとのスリーマン!!! 当日券、配信どちらもあるので皆さまぜひライブをご覧ください\(^o^)/」https://twitter.com/takedamasa/status/1656531498521210880
ショーン・ホラーショー 首振りDollsさん「今夜! 刺激的なスリーマン⚡︎⚡︎☻⚡︎⚡︎」https://twitter.com/kubihuri_shawn/status/1656532131932405760
RYUICHI KAWAMURA INFOさん「【本日5/11(木)開催!】 e+ Streaming+ Ryuichi Kawamura Live2023「Home」#30 “Complete Album VI 〜ЯK Standard 彼方まで〜” 5月11日(木)開演19:00 ※アーカイブ視聴は5/15(月)まで ※ライブ音源の中から3曲をもれなくプレゼント!! https://t.co/hIJshh1OF3 https://t.co/EVwes7IYDx」https://twitter.com/RYUICHIinfo/status/1656539488829734918
leaya(бвб)さん「木曜日なのでゴールデン街カンガルー🦘🦘🦘🦘🦘🦘🦘🦘🦘 19時からやってます 待ってる(º_º)」https://twitter.com/leaya_bass/status/1656555600137048064
(1) 下北沢CLUB Queさん「【本日のCLUB Que】 5/11[THU] “HERE、首振りDolls、赤いくらげ” ◆HERE ◆首振りDolls ◆赤いくらげ OPEN 18:15/START 19:00 🎫当日¥3,800 [1D別] 📺配信¥2,500 [https://t.co/heBx4laD8Q] ~5/17 20:00(視聴期限23:59まで) https://t.co/u5PPutvGHS」https://twitter.com/CLUBQue/status/1656513208998412289
高橋 浩一郎(Kaiki)さん「久しぶりに飲んでる、気管支炎最悪 1週間ぶりか?日常は、大事だよ、普通がいいな。 https://t.co/0SdwlxzCoy」https://twitter.com/STakahashi0823/status/1656583658986409986
lucy+peter=esolagoto / 中村真悟さん「本日!!! 当日KEN御座います!!! https://t.co/yBzIdpoDJf」https://twitter.com/lucy_peter/status/1656585710667984896
首振りDollsさん「東京サイコパスに提供した『シャーロット』、遂にフルMV解禁! 是非チェック宜しく👊」https://twitter.com/KubihuriDolls/status/1656586002692194305
0 notes
orange1896 · 1 year
Text
LOVOL FL958G TILT CYLINDER REPAIR KITS
Tumblr media
LOVOL FL958G TILT CYLINDER REPAIR KITS
Tumblr media
6410007952 支撑块612600117339 LG27130002371A 前桥垫板 26170027081 MOUNT PLATE; BLADE SLOPE SENSOR F21Z1-11300 应急转向泵总成LG19-ZXB-03 29190011551 板 JB999-M27*1.5*50-3 ZJ27120103661 o 型圈 6261000213 机油压力传感器612600081596 6390903739 中间主轴承上瓦495-01006 29090010581 卡簧ER25-16 29170187351 转向柱 6221000089 外接键盘BC-KEY-001 14409535 支板 4120005932019 把手 A59-LGW6150E 手球LGGDS9330001 4041002206 透气管 4120007525 非公路自卸车 4043000481 停用-销轴LGB301-85*115*215G-40Cr(临时号,具体要求见JT 4110002510041 上筋板 28230004901 锁止套 14404305 4110000367075 动臂联小腔右钢管 4110015797009 键 5×19Q5500519 F31Y1-15525 四轴总成(1) 6900019603 接头 3050900058 输入齿轮 4644 302 016 6900021574 蓄电池串联线 6216000414 支承板 26260011181 热敏纸 毕索龙110mm*40mm 28350000961 PLATE 6227000018 柱塞弹簧158560-51160 Mobile/WhatsApp:0086-1525-4934-126 4190015674 螺丝 29330085421 三角带B2388 RS7220 14532050 固定板D00-231-02A+A 4110001310 吸油胶管 LGS816 11213520 雨刮电机E 60112985 4120002295039 EXTRA WATER SEPARATOR Mobile/WhatsApp:0086-1525-4934-126 4043000412 直软管接头C3911925 4041003206 steelQ345D(16*2.5*8) FXG6184-FDX SUPPORTING PLATE 26171015061 两腿柔性吊带 2T*1m 带螺栓M10 4110000081145 螺套式-螺纹接套 11×16mm CEJN-103155066 28110002171 胶管 29240025102 UNDERCARRIAGE 4120009001102 密封圈4WY315-035 26170012001 管夹总成1002358016 4110002750010 衬套 6900018918 软管LGB145-205190 FDH60-7-LT 弯板 28230014671 气门锁夹-C04AL-2A4429 26130017041 左固定板 14403117 LG958轮式装载机 29360008841 溢流阀600D3100-00-B 4110001948071 圆柱销8m6×22 GB/T119.1-2000 4043005311 O型圈 29090013061 中冷进气连接管 11210941 制动钳支架 26331005422 消音器8T 29351000911 六角凹头螺丝M12*50 4110002502 卸荷调节器组件N56903/248A 29390002051 角钢 6233000316 密封件包24A001680S 28230015881 滤网T7104-221-45 2060900419 一级行星架总成 LGG922 管卡 14547986 支架 4110001005406 螺栓 11444158 大腔过载补油阀 MT86H 4190001801 多路阀至左转斗缸大腔钢管 4110002233105 调整垫片 21909004591 板 LG29370023861C F钳 600*140 29010020361 PLATE 7100001912 接头 APC12-04 4110004102 合金钻头 14402164 机油滤芯(LF3970) 6320000136 蒸发器下壳体GKZ33-5.0W-01 F90-90 下叉 29020014331 辅助联右钢管 6213000280 储液罐 Mobile/WhatsApp:0086-1525-4934-126 28070004191 橡胶弯管(13023274)PTD226B-6(13020158)-045 21909010251 熄火电磁阀 14727151 4120001966025 驾驶室C40G 2110900511 液压油散热器S9111915A 4120001583 转斗缸大腔钢管 27130001051 右护板 11215368 胶管F731JSJS161616-1750-FS-F1750-SG1750 9100000804 挡环 0SR100 14721132 变速箱总成TP240E 28280006621 安全标识包 29170086371 销 14405552 钢板t18*1800-SM490A 26330031361 Basic Machine 26290020961 装配固定夹AA00 338 352 L972F 29240011531 侧刀板 4110002276101 窗棂 28310003781 驾驶室LG968X 4190015476 LG953加长动臂加大铲斗装载机 C0960WF04 AIR TANK 4014000119 海绵 C1-2905002381 支撑板 14405383 右支撑杆LY-LG952H-2-00-004 4110001903163 仪表台主架 4120004668 2.1米操纵软轴 28310004451 胶管F372CACF151510-1700-PG450 11219372 接近开关(NPN E2AM12KSQ4M1C1)施耐德 26260100911 螺栓M8X60Q1840860TF2 11214821 控制器护罩 6900013473 转斗缸总成 28060003741 侧减震垫B00800SDB 29360015481 轮边减速器总成FHD9014934610301 29010062241 点型可燃气体探测仪带报警器ES2000T 4110003068013 左灯架板 4190003043 工具箱总成 9200001387 三缸高压油管夹部件HA11402 4110001058001 空调系统总成 28210010142 SEAT 4041001651 PIPE ARM GREASE/EC210C LG8281266 assemble parts 1690100099 加油管组件 YD13 131 013 26170043541 铲斗油缸HSGL-90*60*723-1077 4120002728001 BRACKET_WA CWT MTG 6900021248 变频器 FR-AT40-5.5K-CHT 4110003522 胶管87612-16-16Z/87612-20-16ZXGH493-16CROW 4011000975 管夹 6900019245 左小腔钢管总成 3110901107 丝座 14402245 转向泵总成 6214000482 同步环-第一、二速同步器1701354-950 28210010861 临工953N黄聚氨酯乙型面漆固化剂 F612600090340F GLASS_RH 29290051401 起动电机联接法兰D02C-102-01+A 26240014001 PLATE_BACK-3(SIDE2) / BOOM WA 4.4M 6900000539 操纵箱总成 4110000988148 圆管16*2*30(喷漆) 4110000557040 G9220 平地机 29340031541 55套筒34843 4041002152 LGS812HP全液压单钢轮振动压路机 26260014251 石棉垫 29420006091 停用-喷油泵2W1078 4043001221 活塞环61560030078 4130003618 下梁焊合 4190000451 抓手LGB329-25*2.5*90*580 14406643 JOINT 403062A 29330087771 联接板 3901895F 4120006349007 先导手柄总成模块(去除) 0L0200Y3214A39AA P-螺母GB6172-M12-LHEpZn-05 4110002230019 驾驶室灯开关 4110003492252 右门锁 FXKAH-00657 电瓶 3-D-250 29010074091 仪表盘 1690200118 工作泵吸油钢管 9200000140 发动机总成 26330019851 胶管F372CACF151510-2600-PG750 4110000076286 变矩器控油架 29250011581 胶管FH621CACA151508-1500 ZJ4041000767 法兰螺母 02751-50060 4110001005169 密封圈 29170098831 铲斗缸大腔钢管 29070012821 斗杆油缸HSGK-190*130*1755-2585 6420000360 轮式装载机 4011000564 停用-单向阀组 5111000507 销轴LGB323-70*N*230-1N1G ZJ4130000664 转向缸进油胶管 LG-51-9251-001 隔离套 FYBLX1 油位传感器RG205-700 26240013861 多路阀回油胶管 4041015802 双头螺柱90011620038 14574790 配重铁总成--停用 11214728 驾驶室936T 29330003381 支架 26131003691 中冷器进气钢管 GB32.1-M12*1.25*65 29070200451 主动伞齿轮大轴承内圈工装 6213000321 法兰支架 FZ0000828 软管LGB128-004052 L956F 4110000145033 螺母GB1337-M24*1.5 4041003331 塞规 6296000014 C形孔用弹性挡圈03.02.01.00467 1660600010 板 26020006181 L97X集中润滑采购装机总成(VOLVO桥加高臂) 4110004186197 固定板 6900002237 双头螺柱F7400-1118001 FLG30FBXXXLB 转斗油缸HSGF-190*90*550-1064 CMT96 26360007331 左梯 26180000011 SET, CARETRACK GSM 26020007381 主阀至行走先导阀管路总成 29010053541 推柜锁 震旦 11215710 LG 6- 履带式液压挖掘机 4110016387004 透气管 29290025451 红外夜视摄像头AE-CM10Z 6230000292 旋片式真空泵2XZ-4(抽空速率0.24m3/min,4L/S,极限真空-0.1 FS732-080040 接头体 11212623 安全带2049419 FXKAH-00162F LG936L有驾驶室模块2(机械操纵) 14405089 气缸盖罩盖总成1003045-30D 26120004951 PLATE 8230-13380 28010012361 接头 11216319 风扇460/8-8/S1HL/30/PAG/28.6/-/B 6900003942 连杆 29200007772 行程开关JLXK1-411 5A 29190013831 气扳机 前哨B1031 LG29430002431B 小腔前油管 11218556 海绵 4130000639 不锈钢耐震压力表0-2.5MPa1.6级淄博新时代(分度值0.05)(径向表盘1 F29050017481 弹簧 LG28430000891B P-螺母GB6173-M12*1.25EpZn-05 FXKAQ-00745 座 FDP0546 继电器控制器35240010020 4110002989124 活塞杆总成24A118710 29370026051 左前支撑座 4041000784 发动机罩总成 4110001424057 活塞杆总成24A011380 K1-2924001159 驾驶室总成 26180032061 支架 29380021501 隔爆电机 Mail:[email protected] 4190000924216 气管接头 JPU-10/03 4120000414001 板 4110003770009 前传动轴CDZP-903.7 4110001003144 六角法兰面承面带齿螺栓90011430012 14777177 11217493 主开关支架 6215000197 停用-管盖 29140012931 过渡板A 29240100311 左灯架 4120001053003 钢片 4120008080 板 7200001546 板 4120000560Y 从动螺旋伞齿轮 LG2938001466 LG968(潍柴)唐纳森空滤替换模块 4110001089365 HOSE 6900005879 PLATE 4190002503 开口呆头扳手24GEDORE6002370 29331000011 端盖 11218437 钢管 L953 9200001515 维修包 14668298 E060FQ3481AT6A0 车架线束 4110000697 旋转锉 A0616M06 11210935 轴套 29290040141 前车架线束 4130000710 停用-垫片D03-110-01+A 29120045001 NAME PLATE 26141020251 端板 29160008181 发动机出水胶管 13960150 输出轴 6228000348 后尾灯 L946H FLG933-SXG 行走马达 FKC50118E 过渡风道 F29270001121C 油料加注标识 6900004705 动臂油缸 4120006231042 六角头螺栓Q150B0616 29340016351 发动机进水管 26441009231 热过载继电器 2060700034 起动螺栓01513-50620 28210018121 右立板 29160008261 后横梁 29260010661 上支架 26380006161 设备日常检查点检表 4110000125012 方管 6410005524 急停按钮LAY7(Y090PBC)10A 21909009371 支重轮(好) 11210701 密封件包24A600580S 4030015214 标志与标识 6232000158 六角螺栓 29150032941 盖板B3000-1600021 9200000442 液压油散S9115019C 4110000846014 铲斗总成BG260 ZJ4110000395105 燃油管 4110000172055 不锈钢管6*1 6261000240 连杆下瓦1000187574 29170146341 SUPERSTRUCTURE FRAME 26441002662 活塞24A680190 29050015911 板 29260017751 后车架线束 14406468 滑动块 29330008731 PLATE 6900020121 调速器弹簧16864-56410 4190001146 龙工235-中臂油封 4110015194210 槽钢 F71Q6-03581 空气压缩机道依茨 6253000140 吸油胶管HG4-763-45*700 J4120002319001 挡圈31 GB893.1-86 2010900109017 保险丝RT1863A ∮14.3*51 3214574486 913110 曲轴包 28031001791 非公路自卸车 29020015101 连接螺套13024129 2907002025147 惰轮轴4644308618 FKC5301000010 销轴 11213013 停用-铲斗总成 9100001610 方管45x45-390 4110000081254 泵胆(150-9) 29170146691 回转密封条 2815000535101 螺栓GB5782-M12*110flZnyc-8.8-480 15405638 焊接套 14679713 钢板t24×100×3000 Read the full article
0 notes
custerdome2 · 1 year
Text
☝︎ 詳しくはこちらのブログ レコード評議会 をご覧ください。
0 notes
loonaticons · 4 years
Photo
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
↳ like or reblog. ♡
92 notes · View notes
widinitowi · 2 years
Text
1734 aentr manual espanol
  1734 AENTR MANUAL ESPANOL >> DOWNLOAD LINK vk.cc/c7jKeU
  1734 AENTR MANUAL ESPANOL >> READ ONLINE bit.do/fSmfG
            The examples and diagrams in this manual are included solely for illustrative purposes. Because of the many variables and requirements associated with any Link 2 Activity/ Status. 1734-AENTR. 24 Rockwell Automation Publication ENET-AP005F-EN-P - October 2014. EtherNet/IP Embedded Switch 1734-IE4S Safety Analog Input Module Features. Programming Requirements. CIP Safety Architectures. The examples and diagrams in this manual are included solely for illustrative purposes. Because of the many variables and requirements associated with any particular installation You can examine Allen-Bradley 1734-AENTR Manuals and User Guides in PDF. Database contains 2 Allen-Bradley 1734-AENTR Manuals (available for free online viewing or downloading in PDF): Operation & user's manual, Installation instructions manual . Rectangular Connector Adapter, 15 Contacts(Side1), 15 Contacts(Side2), Panel Mount, Male-Female. 1734-AENT adapter user manual Datasheets Context Search. Assume a system contains 8 digital I/O modules interfaced to a 1734- AENT /1734-AENTR adapter . Артикул: 1734-AENTR Наименование: 2-Port EtherNet/IP I/O Adapter Module Производитель: Allen-Bradley. I/O Adapter and Communication Interface Modules. 1734AENTR 1734A-ENTR 173-4AENTR 1734A ENTR 173 4AENTR. 1734-aentr series c eds September 5th, 2018, 12:34 PM #1 Member Join Date: Aug 2013 Location: Azusa Posts: 23 1734-aent had to replace a 1734-aent series A but when I received the new 1734 I received a series B. my question is will it work on my system I noticed that in the ip web page that in. Производство электроэнергии. 1734-AENTR 1734AENTR. I wish to add an expansion module using a 1734-AENTR module. I have added the 1734-AENTR with 1 digital output module for a simple test setup. The 1735-AENTR has an ip address set to (192.168.1.5), with correct revision etc set. The configuration seems ok to me but I have the 3 erroe below on the User manual point i/o and armorpoint i/o 2 port ethernet/ip adapters catalog numbers 1734-aentr, 1738-aentr, series a. Use this manual if you are responsible for designing, installing, programming, or troubleshooting control systems that use Allen-Bradley I/O and/or compatible controllers, such as Only update firmware when the module is installed behind an Ethernet adapter (1734-AENT or 1734-AENTR). User's Manual Pub. Code: 1734-AENTR Unit of Measure: NR.
https://tolukiwuva.tumblr.com/post/666747732801781761/rinnai-mc-91-2w-standard-remote-controller-manual, https://suqehifax.tumblr.com/post/666710706817761280/preschool-curriculum-handbook, https://cikigevowe.tumblr.com/post/666734141773135872/hp-envy-17t-user-manual, https://napuhikado.tumblr.com/post/666714557469884416/lennox-el16xc1-manual, https://gimikunuda.tumblr.com/post/666742553049235456/svan-971-sound-level-meter-manual.
0 notes
reeiiedu · 4 years
Text
Mensuration
Mensuration Mensuration is a part of arithmetic which is a subject in Geometry. It is an investigation of different mathematical shapes, their length, expansiveness, volume, and territory for 2D just as 3D shapes. Prologue to Mensuration Mensuration Mensuration is the part of arithmetic that manages the estimation of length, region or volume of different mathematical shapes. Shapes A shape is the type of an item. Instances of two-dimensional shapes are square, rectangle and triangle, and of three-dimensional shapes are block, cuboid and circle. Border Border is the complete length or all out separation secured along the limit of a shut shape. Border of a circle is additionally called the outline of the circle. Border of a Triangle Border of triangle = Sum of lengths, everything being equal, = a + b + c. On the off chance that the given triangle is symmetrical that is if all the sides are equivalent (a = b = c), at that point its edge is equivalent to 3 × length of one side of the triangle. Border of a Rectangle Border of the rectangle = length ( l ) + length ( l ) + width (w) + width (w) = 2× [length ( l ) + width (w)] Border of a Square Border of square = 4 × length of a side = 4a Border of a 'n' sided polygon A polygon is a shut shape made down of line portions. Border of n sided polygon = n× length of one side. Model: Length of each side of a hexagon is a cm, at that point:  Border of the hexagon = 6a cm Border of unpredictable shapes Unpredictable shapes are the shapes which don't have all sides and angles equivalent. The edge of sporadic shapes is equivalent to add up to length secured by the shape. Territory Territory is the aggregate sum of surface encased by a shut figure. Region of Square 
Region of a square = Side × Side =Side2=a2, where an is the length of each side. Region of Rectangle Region = length ( l ) × broadness ( b) Region of a triangle Region of triangle = (1/2) × base × tallness = (1/2) × b × h Regions of various sorts of triangles Think about an intense and an uncaring triangle. Region of every triangle = (1/2) × base × stature = (1/2) × b × h Representation of Area In the given chart, on the off chance that the territory of every little square is 1 cm2, at that point Zone of rectangle = l×b = 5×2 = 10cm2 Zone of square = a×a = 2×2 =4cm2 Zone of unpredictable shapes Zone of an unpredictable figure can be determined : Stage 1: Divide the sporadic shape into ordinary shapes that you can perceive (eg. triangles, rectangles, circles and squares) Stage 2: Find the zone of these individual shapes and include them. Total will be the territory of the unpredictable figure. Model: Area of the given figure = Area of MNCB + Area of AMGH + Area of EFND = [ 5 × 9 + 4 × 2 + 3 × 3 ] cm2 = [45 + 8 + 9 ] cm2 =62 cm2
0 notes
lewonald · 4 years
Photo
Tumblr media
Elvis Costello & The Attractions ‎– Get Happy!! 1980 mofi盤(45RPMX2)と英国オリジナル盤聴き比べてみた。やはりmofi盤は良くない。🇬🇧盤のグイグイくるベースが死んでる。 このアルバムは大好物、やっぱSide2から聴くよね!B Movieの楽器の聴こえ方なんて、たまりませんね。 #elviscostelloandtheattractions #nicklowe #popfreak宇都宮 https://www.instagram.com/p/CASeoDxpBam/?igshid=juexzpkbiart
0 notes
kari3622-blog · 4 years
Photo
Tumblr media
The Bobby Timmons Trio In Person 本日5月4日は、ご存命の現役レジェンド、"Mr. Base Man"ことロン・カーターのBirthday!1937年5月4日生まれの83歳、お祝い投稿と言うことで私が選んだのは、ボビー・ティモンズ・トリオ!これを是非とも聴いて欲しいと思います。 当時、このトリオが長期間出演していた名門The Village Vanguard, NYでの1961年10月1日のライヴ盤。ファンの間では人気のライヴ盤で、ティモンズの最高��品と呼ぶ人も。 ロン・カーターは、1959年にチコ・ハミルトンのグループでプロデビュー、1963年マイルス・デイヴィス・バンドにポール・チェンバースに代わるベーシストとして抜擢され60年代のマイルスを支え、76年からハービー・ハンコック、フレディ・ハバード、トニー・ウィリアムズらによるV.S.O.P.クインテット、そしてハンク・ジョーンズによるG.J.T.での活躍が有名ですが、初期の本作トリオでのロンは、後の名声が当然と確信できる実にモダンな趣のあるベースを聴かせてくれます。 親日家として知られ、近年も日本に度々訪れ、2020年4月10,11日にはRon Carter Golden Striker Trio、メンバーはRon Carter(b)、#DonaldVega (p)、#RussellMalone (g)で、BLUE NOTE TOKYOで公演も予定されていましたが、残念ながら新型コロナウイルス感染防止のため延期となり、未定のまま。 さて、本盤について... 。 オリジナルは、 #RiversideRecords ‎- RLP 9391、本盤は「リバーサイド・オリジナル・レコーディング・シリーズ」SMJ-6110 日本盤。1961年秋、ジャズ・メッセンジャーズ脱退後に結成したティモンズ自身のトリオによる記念すべき第1作です。同年6月のImpulse!盤"Art Blakey's Jazzmessengers"がJM最後の吹き込みで、その後が本作。Riversideでは4枚目のリーダー・アルバムで初のライヴ盤。 録音評ですが... ライヴはShure SC35C。楽器が硬めの音質で前に来ます。高音域寄りのバランス、私的には包まれるようなライヴならではの臨場感が欲しかったですね。 ですが、Shure M44-7にすると強さが加わり、ファンキーかつアーシーな彼のピアノが際立ちます。ロンの控え目の渋いベースもスピーカーが割れんばかりのシャープな重低音で楽しめますし、Side2-3"Softly, As In A Morning Sunrise"などではソロもたっぷりですよ。 ティモンズのリーダー作品は大半がトリオ形式で、気の合った仲間を集め、とても自由にリラックスして演奏を心から楽しんでいるように思います。本作もトリオ結成間もないのに、とても完成度の高い演奏で、ファンキー・ジャズと言う小さい範疇に留まらず、トリオのバランスにも拘り、何より聴衆に楽しんでもらいたいと言う熱意を感じる素晴らしいライヴだと思います。JMから解き放たれたように感じます。 "Autumn Leaves", "Softly, As In A Morning Sunrise"などのスタンダードを彼なりの解釈で聴かせてくれるところが本作の良さですが、私は自作のファンキーかつゴスペルな"So Tired"と哀愁の"Popsy"に惹かれますね。両面最後に収録されているキャノンボール・イン・サンフランシスコや自己のアルバムでも度々演奏されている名作"Dat Dere"がテーマだけでフェードアウトなのは、かなり残念ですが... 。 #BobbyTimmons (p) #RonCarter (b) #AlbertHeath (d) Producer - #OrrinKeepnews Recording Engineer - #RayFowler Mastered By - #BernieGrundman Backliner Photo - #SteveSchapiro Front Cover Photo - #DonaldSilverstein Album Design - #KenDeardoff Produced by - #BillGrauer Productions, Inc. ファンキーの代名詞のように言われるティモンズですが、私はアーシーさと教会音楽やゴスペルをベースにした黒人特有のソウルフルでリリカルな表現力が大好きです。派手さはないけど、静かに熱い謙虚さに魅力を感じます。 #jazz #fuzey #vinyl #jazzvinyl #vinylcollection #ジャズ #スイングジャーナル #レコード #stayhome *作品を知るとジャズはもっと輝きます。情報くださる先輩諸氏に感謝。 https://www.instagram.com/p/B_xH156J9px/?igshid=1naevhtfgsppf
0 notes
michaelmotorcycle2 · 5 years
Text
My solution...OCD, part 3A and part of 3B revised on 11/2
            Part III,a
I suppose I should give several examples, because the method called disassociation I use is not as easy as first glance may suggest. The difficulty associated with a method of disassociation depends on the user. If one struggles to see how on earth anyone could find a solution for x when 2x + 3y =25, 4x - 2y = 34 and x +2y = 23 then you may not see what makes disassociation a challenge and will think it is as they say, easy peazy. Good for you, and I am not being sarcastic, because ignorance of... can, with certainty, be bliss. 
As a matter of fact, I am certain I am glad I am ignorant of seeing the future, because on one hand it would be nice to know what horse would win the race, but more importantly I would not be emotively equipped to deal with knowing of the horrible event that will occur in 3 days. Why? Presumably the event is one that I have no ability in which to effect an outcome. Knowing in advance my best friend is going up in flames in an airline crash 3 days from now with out the ability to effect change would be too much for me to handle. 
The next two sections will explore two examples involving disassociation. The first example primarily has (is) as the culprit. The second example has (not) as the culprit. In each, I will show the reader why the part of me that is reflected in my finding the solution to x in the preceding example easy makes disassociation more of a challenge for me than perhaps with others, but if you can pull it off the method is excellent with respect to sending anxiety to zero almost immediately.
Before I start the first example let me high-light or summarize several observations:
1st: 
In general my issue is with patterns of speech such as (is) which has as its source multiple meanings such as our allowing the term to mean what follows (is) has an association with what precedes (is) where this association is very general and can be many things including by being a constituent part of the preceding object or by perhaps being an emotive attitude regarding... or name used as a stand in for the preceding object. In sentence form there is no apparent difference between (is) meaning part of, and (is) meaning has as its name. For me this creates the same effect that one would get by letting alive mean both 'alive' and 'dead' followed by saying, "my child is not alive." This often is too emotively disturbing, at least for me, and has been one of the triggers involved.
What I find interesting is knowledge is not sufficient to attenuate the disturbance I feel when an object is being suggested as having an objective property which in reality is false. What do I mean? Were alive to be allowed to have two meanings where one meaning is 'alive' and the other meaning is 'dead' in spite of knowing what was meant when I said "my child is not alive" its not ever emotively OK with me to verbally model reality in this fashion, at all. I want to at the very least remove such a definition for me, if no one else. Additionally, I do not want to change or desensitize myself to misleading language such as what is being highlighted in this essay at all. In terminology I recently read, I'd rather drink acid before desensitizing myself to triggers such as these I am writing with respect to.
2nd: 
In general my issue with (not) also is due to misleading meanings that have been allowed by not having well-defined be much of a priority by those that gave us our current language. Rather than spending any time on this specific issue I will let example 2 explain the problems caused by (not) being other than well defined. Again this issue is not one that desensitizing myself to misleading language is something that I will tolerate. 
3rd: 
In general, had language been well thought out in a manner that mathematicians must utilize otherwise conjectures can not become proven theorems I doubt that OCD would be a term I was intimately familiar with. Oh well I am, and I have had to adapt to the triggers and the examples are two fold in that they exemplify the structure that serves as the trigger and how I have been able to, in a sense, remove or deactivate the trigger. 
4th: 
There will be some that having read this essay would like to lecture me like a wayward school child for welcoming belief/denial and removing for myself language that suggests emotive attitudes that they prefer to see portrayed as objective properties of the object being referenced... Good for them, and here I am being a bit sarcastic, because all they would accomplish is relaying their feelings in a manner that most likely was presented so as to suggest objective and I would inwardly think of the photograph of the individual holding a sign that read "Thank You for Sharing Your Feelings" behind the protester holding the sign, "Homosexuality is a Sin!" Otherwise, I get it, some or many are hardwired to view the world in a manner that coincides with their emotions and for them this is not a problem because they can't see the edge of their emotive lens that otherwise would tell them differently. Plus, like me they are not willing to change their emotive attitudes or responses either. And, of course they consider their attitude as right, probably where right is somehow the objective-right. Why, because evolution hardwired them to do so, since the scheme often but not always leads to more likely to survive regardless of the intellect that accompanies the faculty for emotion.    
 Example 1:
In this example I am using the symbol Nigger because it is very emotively disturbing, especially for those of the black race. However, to show subtle but important differences the symbol is being utilized two different ways. The first use is rather easy to disassociate but the second usage is challenging if you can easily see abstract structures in a manner that is clear and comprehensible. In my examples I am being pedantic so as to most convey what others may not see so that perhaps they too can, for the first time, see the challenges that may, depending on the individual, be involved?
To provide preliminary required information I need to share the following. Why this information is required will become apparent once we look in detail at the examples I have provided.
{
1: Previously I had mentioned that (is) has multiple meanings which I have more or less consolidated into four classes or four general meanings. One meaning indicates what: precedes (is) has what follows (is) as a constituent part of it the object that precedes (is). This meaning is seen in: "The 1963 Kennedy half dollar is silver." Another meaning of (is) indicates: the object, let's call it alpha, that precedes (is) has associated with it what follows (is) by what follows (is) stands in for or represents alpha. This second meaning is seen in: "He is Joe." 
2:A: Suppose you wanted a symbol to stand in for the concept of an object having 4 sides and a bottom assembled in a specific manner such that the object has a volume of space within the 5 pieces making up the object.
B: Let's not be unique and let the symbol that represents the concept from above be 'box.'  
C: OK, we have this:
'Box' refers to our mental integration of side1, side2, side3, side4, and bottom, into the concept or model of an object assembled in a specific manner.
D: If we were teaching a child we would find an appropriate object and while pointing at the object say, 'box' represents or stands in for it, the object pointed at, understand Joey? Since 'box' stands in for the object that is being pointed at by the adult; the adult will also say to Joey, "It is box." Here the meaning of (is) indicates what 'it" is pointing at has as a symbol of representation, 'box.' We all have been on both sides of this phenomenon and through repetition the symbol takes on meaning within our mind.
*E: With the above in mind and using the parts involved in 'box' as an example: If you had a stack of bottom pieces to an un-assembled box and picked one of the pieces up you would have in your hand a part of what 'box' represents or stands in for. Why? Because by allowing (is) to indicate representation as in, [(the four sides and bottom assembled as...) is a (box)] we also allow for (the bottom I hold in my hand) is part of a (box) or partially a (box). This last observation may seem to be "why bother" at the moment, but later in this essay it will take on importance. 
}
 Part A of example 1: 
Let us use Nigger as the symbol and let us give this symbol only the attribute of being a name that stands in for a specific person or subset of humanity. Here we can simply disassociate the symbol from both the group and the individual as easily as changing your name. How do we do this? We think: Nigger does not represent the specified subset of humanity. What we just thought is true for our self because representation is a property of one's mind not a property of the symbol or the object that someone is allowing the symbol to stand in for. 
However, I emotively need Nigger to have no meaning, period. I suspect I am not alone. Hence, I will allow my self further disassociation by choosing to belief Nigger does not nor can it stand in for anything at all. Did I bend reality to obtain the removal of an emotive disturbance? I sure did. As a comparison, I imagine that many would say "It's not right or correct" to use Nigger as a representation of them or another. I also imagine their not-right for them is being seen as a constituent part of what is being referenced otherwise some how objective. 
Unfortunately, their not-right is emotive and in reality amounts to saying the key does not match or partially match the lock because I don't want it to. This view really is not much comfort without the added on belief that the 'not-right' being used is objective, meaning a constituent part of what is being referenced. I don't bend reality like those that turn an emotive not-right somehow into an objective not-right because it offers problems elsewhere. I bend reality by believing what I find emotively disturbing is completely impossible and therefore objectively not-right meaning false as a result of can not exist. The end result is essentially equivalent except I am not a fan of envisioning subjective views as being somehow objective, but I am not opposed to believing objective attributes such as false or true are fitting when emotively necessary. So, yes, we bend reality to remove emotive disturbances, not just myself.
The first half of this example was essentially easy and amounted to removing Nigger as a symbol that referenced an object or any object in one's environment. The next piece of this example is where disassociation becomes a bit more of a challenge.  
Part B of example 1:
Now suppose Nigger stands in for an internalized concept/model that I will later call Z so that I don't have to retype the verbalized model multiple times. In this part of the example I am letting Z stand in for: "ape-like, human-like, dumb, black, two-eyed, two-legged,..being." Here, Nigger is more than just a name for it carries with it a concept as well and the symbol Nigger only serves to deliver the concept to whomever Nigger is directed at. Simply disassociating the symbol would not be sufficient for one also needs to disassociate the concept as well. One might think that, I am not Nigger nor Z is sufficient? Is it? Let's examine the question:
1st: 
If you are like me then you need more than "I am not Nigger" because you emotively need "not at all" attached to the denial because any link to or association with Nigger is emotively disturbing for you. Let me explain this a bit with a mental experiment:
Imagine you and your mates taking what is strictly pejorative such as asshole or worse followed by each in the group attempting to strip away the pejorative. Now ask yourself, how well the following resonates within you: All your mates in the office use asshole in lieu of other pronouns for each other from then on. 
I don't think what I asked you to imagine will succeed for long; if it even were to get off the ground. Why? In a sense the pejorative meaning is like radiation that takes a very long time for its harmful effect to be neutralized, where time needed may be measured in generations. We, certainly me, can not, nor do I want to, divorce negative associations on whim or by will and they have a way of poisoning what ever is attached to them as well. Hence, I am not comfortable at all with out having "not at all" attached to the denial. 
One also must remember that issues or sensitivities like this are idiosyncratic and, by example, just because I was OK with riding down the steep hill from Altamont NY when I was 18 years old did not mean my friend Jim felt the same way. After all he had a different set of emotional associations that came from having his face peeled off by going thru a windshield on the very same hill. And please let us not become pretentious by saying an-others sensitivity is not-right where this phrase, by the language used, is meant to suggest not-right is objective. The not-right is emotive and simply is indicating you are not in emotive agreement with one having the particular sensitivity and I feel more than a bit arrogant although at times I prefer feel more than a bit stupid to think or pretend otherwise.  
2nd: 
Needing 'not at all' attached to the denial creates a problem of its own when using language that treats Nigger and its associated concept  like they are real. The issues at first glance may be unseen but are emotively disturbing once seen. What do I mean? Remember item E which I placed * in front of the E and had said this will be important later on, well now is where its significance manifests itself. If we treat, as real, the concept I called Z that Nigger referred to where the symbol Nigger serves to deliver the concept to whomever Nigger is directed at we have an issue to deal with:
Issue: 
How well does being part or partially a Nigger resonate with you? I ask because in the same way that the bottom of the box one held in their hand was part of or partially a box as seen in item E, the way I structured Z we have (two eyes) are part of or partially a Nigger. I can do without this being a fact of life I have to live with as much as any woman can do without women being inferior to men is a fact of life they have to accept and get over. So one way or another I am removing what otherwise is a disturbance that I just can't tolerate. 
In one sense the issue of being part or wholly a Nigger is easy to remove and that comes from we need to recognize Nigger as a realized being is as real as the Unicorn and change our language to reflect this. Hence like the Unicorn, where real, does not exist and not-Unicorn, where in not-Unicorn, Unicorn is real, also does not exist we have: I am neither Nigger nor not-Nigger nor am I part Nigger nor not-part Nigger. Essentially what the previous sentence is saying is I am not nothing nor am I part nothing. 
OK, are we done with this issue? Unfortunately not. Why?
Because, what I can't forget is that the Z someone created in their imagination is like the case involving the Unicorn. Where Unicorn can also represent a conceptualized structure having specified or inferred attributes. Where this structure is real only as a concept but not real beyond just being an assembled and imagined structure out of one's imagination much like a fictional vehicle in a movie or novel. Again, I am not really fond of saying I am somewhat or partly the conceptualized 'Z which has two eyes and two legs." Frankly, I don't know anyone, certainly not me, who would really tolerate "I am somewhat or partly, "ape-like, human-like, dumb, black, two-eyed, two-legged,..being." Do you? 
What do we do with this last issue? There are some I imagine who will let their emotive objection to having partially being the concept of a Nigger be fitting for them be translated into "it just is not-right" and somehow believe this removes their being partly the conceptualized Nigger. If they can, fine. I can't. So, what do I do. One of two things. 
Either
A: 
I allow via belief the concept to also be as real as the Unicorn, hence, because I allow my self to believe the concept completely does not exist, I think once again: I am neither at all. Followed by if necessary: there is an alternative that does not provide me with what I can not tolerate and that is what I am, where I take this on faith and do not try to build the structure that supports the belief. 
Or
B:
I simply think that there is no I am a Nigger and its components, at all, no meaning of; followed by there is an alternative to the components or structure of language in the conceptualized Nigger that does not provide me with what I can not tolerate and that dictates what I am. I take this on faith and do not try to build the structure that supports the belief. Why not? Because, the whole idea behind disassociation is to quickly end the trigger's capacity to turn on anxiety. By trying to figure out a suitable structure for the belief to be realized as in detail all one accomplishes is igniting anxiety and once it burns its harder to put out. So, again I don't try and it is remarkable at how well the method works and here I'll send my thank you card to evolution for having given us denial and belief in our tool box.
Both methods in the preceding paragraph for addressing the issue is very much the use of faith as seen in conjunction with various religions. If being partly a Nigger did not disturb me in a manner that a woman would surely be very disturbed by from needing or being required to accept men as superior, then, I would not need to use belief as a tool or disassociation as a tool. However, that is not the case and I am not in emotive agreement with changing my emotive sensitivity at all, so it is this or nothing and I'd rather live and be productive than live as the tormented. 
This particular example may or may not be extremely upsetting to me and I was merely using it to convey the concept, however cases that I kept private are very emotively upsetting to me. Regardless of how I end up disassociating the disturbing issue the result is the same in that almost immediately the anxiety goes to zero and from having built from scratch the electronics device that changes a computer's memory from 1 to zero I recognize that what disassociation thru belief has accomplished is very similar to sending the electrical signal feeding the machine's memory of 1 to ground such that the memory now is zero.   
Part III,b
If you think I was a bit abstract and therefore hard to follow when I presented example 1 then maybe you should stop reading. By reading this far, for the outsider, one has conceivably learned a lot or recognized their self. I have a need to be both pedantic and still readable in this section and will try my best to do both although I admit what I have written is certainly not the light reading I wish it could have been. Unlike example 1 here the issue is essentially (not) where in example 1 the issue was primarily (is) which if it had not been used to assign representation and also indicate properties it probably would have never been an issue for me.
Example 2:
I will not give a precise case that triggers the unrelenting need to remove the unwanted in this example because it is liable to be distracting by raising the question, why the heck does it disturb you followed by your nutty. None of us had any choice in how evolution emotively wired us; rather, evolution can be thought of as an ongoing science experiment and much like a software engineer that tries out mapping a different color to the monitor the end result is we all tend to have our idiosyncratic differences. Hence, I will use a structure that, except for differences in the elements within the structure, are essentially the same structure where this is referred to as they are isomorphic. For example any pair of lovers sitting on a park bench is isomorphic to any other pair regardless of their unique identities or ages or...
First, will you agree with me that given a house is imaginary that inside the house is also imaginary and outside = not-inside, (where inside is real), is also imaginary? What happens were the house real for somethings but not others? Our common language does not easily account for this and often what ends up being used as a verbal model is very lossy with respect to the information it contains and in a sense is like a kid's crayon sketch of your house when compared to the actual house.
Let us create a realization of the concept:
Suppose there are two lots on a street side by side. Call these 1550 Main street and 1552 Main street. Suppose there are two houses where house-A is located on 1550 Main St. and house-B is located on 1552 Main St. Suppose ball-A strictly belongs to house-A and ball-B strictly belongs to house-B where each ball can only be 'inside of', or 'outside of (where inside is possible)' their respective houses and being 'inside of' or 'outside of (where inside is possible)' the other house is imaginary. 
Sure, we can envision the space containing both houses and since ball-A is absent from inside house-B we can say ball-A is not-inside house-B; but is what we just said precisely faithful to reality? No it is not and the reason for this is that it is being one dimensional much like modeling you by your height alone. Additionally, the phrase has multiple meanings where one meaning is real and the other meaning is not real for both states.
I suspect, you may be having a hard time wrapping your head around this because you keep seeing house-B as real in reality and ball-A being outside of it, right? So let us create a formal but short proof to show what I have said is not wishful thinking on my part:
Given:
ball-A being inside house-B where: inside house-B is possible for ball-A is real,- does not exist.
ball-A being not-inside house-B where in (not-inside house-B): inside house-B is possible for ball-A is real,- does not exist.
house-B is real in the big space of Existence.
Question: if we look is ball-A inside house-B? No.
Question: Does the above indicate ball-A is not inside house-B?
Let us check using * as a guide:
{Please note: possible and possibility here is defined as being both free to be and free to be other than. ie They have the meaning that coincides with being in a sample space and therefore a potential for being realized. There are other common meanings where one meaning coincides with: essentially imagined as free to be or not and the other simply denotes existence somewhere} 
*Find me something in reality that is not a unicorn where a unicorn is real for this thing to not be.
{here the above is totally impossible and not-a-unicorn where unicorn is real is totally as imaginary as the unicorn everywhere in Reality}
OK, let us apply the same check with respect to not-inside-house-B.
Find me a something in reality that is not inside house-B where inside house-B is real for it to be.
{here I can only find one thing and that is ball-B; on the other hand: [(not-inside-house-B) where (inside house-B ) is real for ball-A] is as imaginary as you or I being not-a-unicorn, isn't it?}
QED ie. that which was to be shown valid has been shown valid.
OK, what is happening is that for ball-A the states inside & not-inside, where the later state being real strictly with respect to ball-A is determined by the first state called 'inside' being a real possibility for ball-A, are both imaginary. However, house-B does exist in the large space called Existence. Sure, ball-A is outside of house-B, but ball-A is also outside of (not-inside-house-B) where in this state, (inside-house-B) is a real possibility for ball-A. 
In this example an accurate model of this case involving ball-A is seen in these sentences:
With respect to each, (inside-house-B/not-inside-house-B), being a real possibility for ball-A; there is no ball-A is either (inside-house-B or not-inside-house-B).
-------------------------------------------
Ball-A is outside of (inside, not-inside house-B) where each are real possibilities only for ball-B and otherwise do not exist as real possibilities for ball-A.
An example that is isomorphic to the emotive free example given by ball-A..., but does have a fairly strong emotive impact is seen in this extra example. Here I'll ask the reader which verbal or internal model of the following cases are capable of being disturbing:
    1: I am not having same-sex sex today. 
    2: I am outside of (having, not having) same-sex sex today, where each are real possibilities only for others.
    3: I am not wearing diapers today.
    4: I am outside of (wearing, not wearing) diapers today, where each are real possibilities only for others.
I am almost certain I would know your selection and while two of the verbal models and their associated internal models are capable of being disturbing, they are not even close to specific examples that strongly effect me. 
What I find interesting with respect to (1) and (3) are two observations. 
A: 
First, again knowledge is not sufficient. What do I mean? Knowing that (1) is indicating the state of being seen in (2) is not sufficient to turn off disturbing, at least for me. For me, this situation is similar to letting alive mean each of dead and alive. Essentially I don't care if I know I am not alive means I am not dead; its simply not emotively OK with me to either verbally model or internally model reality in this manner. 
B:
While I had no choice in how I emotively respond to to either model; I have no desire and I am totally opposed to altering my emotive response, where this reaction to the concept of changing myself also is hardwired into my essence. 
0 notes
this-is-html · 7 years
Text
[TUTORIAL]  Criando uma sidebar simples e fácil.
Foto
Tumblr media
Vamos fazer duas divs no css
~Coloque os códigos abaixo ANTES de </style>:
1.
#sidebar {    padding:20px;    width:150px;    margin-bottom:15px;              background:#ffffff;    font-family:pt sans;    border:1px solid #eee; }     
2.
side2 {   width:170px;   position:absolute;   top:0px;   left:50%;   margin-left:calc(-{select:post width}px / 2 - 275px);   -webkit-animation-name: fade-in;   -webkit-animation-duration: 1.5s;     }
Explicando alguns nomes dos código: 
Padding: Espaçamento completo da sidebar. 
Width: Largura.
Margin-bottom: Uma margem na parte inferior da sidebar.
Background: Cor de fundo da sidebar. 
Font-family: A fonte do texto da Sidebar.
Border: Borda ao redor da sidebar.
Solid: Borda sólida.
Position:absolute: Não deixa a sidebar fixa na tela.
----------------
Criando uma div para imagem
~Coloque DEPOIS de </style> 
.wift {border:1px solid #eee; margin:30px; padding:10px; background:#fff;  width:76px; margin-left:25px; margin-top:-40px; box-shadow: 1px 1px 1px #eee;}
----------------
Colocando ela no <body> 
~Coloque o codigo abaixo DEPOIS de <body>! 
<aside> <div id="d"> <a href="/" title="Welcome!"> <img src="LINKIMAGEM" class="wift"> </a> 
<div style="font-family:pt sans; font-size:11px; letter-spacing:1px; text-align:center; margin-top:10px; background-color:#fafafa; padding:3px;"> <b>  ESCREVA ALGO AQUI </b> 
{description}
<br> </div> 
</aside> 
Pronto!!! Se foi útil de like, por favor! Obrigada sz
8 notes · View notes
margdarsanme · 4 years
Text
NCERT Class 12 Computer Science Chapter 2 Object Oriented Programming Concepts
NCERT Class 12 Computer Science Python Solutions for Chapter 2 :: Object Oriented Programming Concepts
 TOPIC-1
General OOP ConceptsShort Answer Type Questions (2 marks)
Question 1:How is a static method different from an instance method?Answer:Static method has to be defined outside a class. It can be called without an object.Instance method is defined within a class and has to be invoked on an object.
Question 2:Explain Data Hiding with respect to OOP.Answer:Data hiding can be defined as the mechanism of hiding the data of a class from the outside world or to be precise, from other classes. Data hiding is achieved by making the members of the class private. Access to private members is restricted and is only available to the member functions of the same class. However the public part of the object is accessible outside the class.
Question 3:Fill in the blanks:
Act of representing essential features without background detail is called ______ .
Wrapping up of data and associated functions into a single unit is called ______ .
______ is called the instance of a class.
Answer:
Data Abstraction
Encapsulation
Object
Question 4:What is Object Oriented Programming? List some of its advantages.Answer:OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. Advantages:
Simplicity
Modifiability
Extensibility and Maintainability
Reusability
Security
Question 5:Differentiate between an object and a class.Answer:A class is a collection of objects of similar type.For example, mango, apple and orange are members of the class fruit. Classes are user-defined data types and behave like the built-in types of a programming language.The syntax used to create an object is not different than the syntax used to create an integer object in C. If fruit has been defined as a class, then the statement fruit mango; will create an object mango belonging to the class fruit.
Question 6:Explain polymorphism with an example.Answer:Polymorphism is the ability for a message or data to be processed in more than one form. An operation may exhibit different behaviors in different instances. For example, consider the operation of addition of two numbers, the operation will generate a sum. If the operands are strings, then the operation would produce a third string by concatenation.
Question 7:List three features that make an important charac-teristic of OOP.Answer:
Capability to express closeness with the real- world models.
Reusability-allows addition of new features to an existing one.
Transitivity-changes in one class get automatically reflected across.
Question 8:How do we implement abstract method in python? Give an example for the same.Answer:Abstract method : An unimplement method is called an abstract method. When an abstract medhod is declared in a base class the derived class has to define the method or raise “Notimplemented Error”
Or
Abstract Method can be used to enable parent class method execution.Class Shape (object):def findArea (self): passClass Square (Shape):def init (self, side):self, side = side def findArea self.side*self.side
Question 9:List few disadvantages of OOP.Answer:
Classes tend to be overly generalized.
Relationship among classes might become artificial.
Program design is tricky and complicated.
More skills and thinking in terms of objects is required.
Question 10:Explain Function overloading with an example.Answer:When several function declarations are specified for a single function name in the same scope, the function is said to be overloaded. In other languages, the same function name can be used to define multiple functions with different number and type of arguments, def test(): #function 1 print “hello”def test(a, b): #function 2return a+bdef test(a, b, c): #function 3return a+b+c 2
Question 11:What is inheritance? Explain with an example.Answer:Inheritance is the capability of one class to acquire the properties or capabilities of another class. For example, the bird ‘Parrot’ is a part of the class ‘Flying Bird’ which is again a part of the class ‘Bird’.
Question 12:How data encapsulation and data abstraction are implemented in Python, explain with an example.
Or
How do abstraction and encapsulation complement each other?Answer:Abstraction and Encapsulation are complementary concepts. Through encapsulation only we are able to enclose the components of the object into a single unit and separate the private and public members. It is through abstraction that only the essential behaviors of the objects are made visible to the outside world.So, we can say that encapsulation is the way to implement data abstraction. For example in class Student, only the essential information like roll no, name, date_of_birth, course, etc. of the student will be visible. The secret information like calculation of grades, allotment of examiners etc. will be hidden.
Question 13:Consider the figure given below and answer the questions that follows:
Name the base class and the derived class.
Which concept of OOP is implemented in the figure given above?
Answer:
Base class – STUDENTDerived classes – GRADUATE & POST GRADUATE
Inheritance
Question 14:What is abstract method? Give a suitable example to illustrate the same.Answer:Abstract Method: An abstract method is a method defined in the base class, but does not require code for the implementaion. e.g.,Class teacher: def entry (self):teach#=int(input(“Enter No”))def display ( ):print (self, teach #)
Question 15:What is the concept of overriding method? Give an example for the same.Answer:Overriding Methods : It is a method to access, the paramterized constructer with same name but having different parameters. For example,Class emp:def_init_(self, n):self, a = n def_init_(self):self, a = 100
Question 16:Is function overloading supported by Python? Give reasons.Answer:A given name can only be associated with one function at a time, so cannot overload a function with multiple definitions. If you define two or more functions with the same name, the last one defined is used.However, it is possible to overload a function, or otherwise genericized it. You simply need to create a dispatcher function that then dispatches to your set of corresponding functions. Another way to genericized a function is to make use of the simple generic module which lets you define simple single-dispatch generic functions.def test(): #function 1print “hello”def test(a, b): #function 2return a+bdef test(a, b, c): #function 3return a+b+cIf you run the code of three test functions, the second test() definition will overwrite the first one. Subsequently the third test() definition will overwrite the second one. That means if you give the function call test (20,20), it will flash an error stating, “Type Error: add() takes exactly 3 arguments (2 given)”. This is because, Python understands the latest definition of the function test() which takes three arguments.
Question 17:Predict the output of the following program. Also state which concept of OOP is being implemented?def sum(x,y,z):print “sum= ”, x+y+zdef sum(a,b):print “sum= ”, a+bsum(10,20)sum(10,20,30)Answer:Type Error: sum() takes exactly 3 arguments (2 given)Concept: Polymorphism [Function Overloading]
Question 18:Define binding. Differentiate between static and dynamic binding.Answer:Binding is the process of linking the function call to the function definition. The body of the function is executed when the function call is made. Binding can be of two types:Static Binding: In this type of binding, the linking of function call to the function definition is done during compilation of the program.Dynamic Binding: In this type of binding, linking of a function call to the function definition is done at run time. That means the code of the function that is to be linked with function call is unknown until it is executed.
Long Answer Type Questions (4 marks)
Question 1:Write a program that uses an area() function for the calculation of area of a triangle or a rectangle or a square. Number of sides (3, 2 or 1) suggest the shape for which the area is to be calculated.Answer:from functools import wrapsimport mathdef overloaded(func):@wraps(func)def overloaded_func(*args, **kwargs):for f in overloaded_func.overloads:try:return f(*args, **kwargs)except TÿpeError:passelse:# it will be nice if the error message prints a list of# possible signatures hereraise TÿpeError(“No compatible signatures”)def overload_with(func):overloaded_func.overloads.append(func)return overloaded_funcoverloadedjunc.overloads = [func]overloaded_func.overload_with = overload_withreturn overloaded_func
#############©overloadeddef area():print ‘Area’[email protected]_withdef _(a):# note that, like property(), the function’s name in# the “def _(n):” line can be arbitrary, the important# name is in the “@overloads(a)” lineprint ‘Area of square=’,a*apass
@area.overload_withdef _(a,b):# note that, like property(), the function’s name in# the “def _(nl,n2):” line can be arbitrary, the important t# name is in the “@overloads(a)” lineprint Area of rectangle=’,a*[email protected]_withdef _(a.b,c):s= (a+b+c)/2print sprint Area of triangle=’, math.sqrt(s*(s-a)* (s-b)*(s-c))passchoice=input(“Enter 1-square 2-rectangle 3- tr-iangle”)if choice==1:side = input(“Enter side”) area(side)elif choice ==2:length = input(“Enter length”)breadth = input(“Enter breadth”)area(length,breadth) elif choice==3:a = inputfEnter sidel”)b = inputfEnter side2”)c = inputfEnter side3”) area(a,b,c)else:print “Invalid choice”
Question 2:Write a program to find out volume of a cube, cuboid and cylinder using function overloading.Answer:from functools import wraps import math def overloaded(func):@wraps(func)def overloaded_funcfargs, **kwargs):for f in overloaded_func.overloads:try:return ff args, **kwargs)except TypeError:pass 1else:# it will be nice if the error message prints a list of# possible signatures here raiseTypeError(“No compatible signatures”)def overload_with(func):overloaded_func.overloads.append(func)return overloaded_funcoverloaded_func.overloads = [func]overloaded_func.overload_with = overload_withreturn overloaded_func #############@overloadeddef volume():print ‘Volume’[email protected]_with def _(a):print ‘Volume of cube=’,a*a*a, ‘cubic units’[email protected]_with def _(a,b):print ‘Volume of cylinder, 3.14*a*a*b,‘cubic units’[email protected]_with def _(a,b,c):print ‘Volume of cuboid=’, a*b*c, ‘cubic units’passchoice = input(“Enter 1-cube 2-cylinder 3-cuboid”)if choice==1:side = input(“Enter side”)volume (side)elif choice ==2:radius = input(“Enter radius”)height = input( “Enter height”)volume(radius,height)elif choice==3:length = input(“Enter length”)breadth = input(“Enter breadth”)height = input(“Enter height”)volume (length, breadth, height)else:print “Invalid choice”
Question 3:Write a class CITY in Python with following specification :
Code  # Numberic value
Name  # String value
Pop  # Numberic value for Population
KM  # Numberic value
Density  # Numberic value for Population DensityMethods:
CalDen ( ) # Method to calculate Density as Pop /KM
Record ( ) # Method to allow user to enter values Code, Name, Pop, KM and call CalDen ( ) method
See ( ) # Method to display all the date members also display a message “Highly Populated Area” is the Density is more than 12000.
Answer:class CITY:def _init_ (self):self. Code = 0self. Name =” ”self. Pop = 0self. KM = 0self. Density = 0def CalDen (self):self. Density = self. Pop/self. KMdef Record (self)self: Code = input (“Enter Code”)self.Name=raw_input(“Enter Name”)self. Pop = input (“Enter population”)self. KM = input (“Enter KM”)CalDen (self) // or self.CalDen ( )def See (self):print Code, name, Pop, KM, Densityif self. Density > 12000:print (“Highly Populated Area”)# OR print (“Highly populated Area”)Note : Accept self. _Cose to indicate private members
Question 4:Give a suitable example using Python code to illustrate single level inheritance considering COUNTRY to be BASE class and STATE to be derived class.Answer:Class COUNTRY: statejist = [ ]def_init_(self, name):self.name = name class state (COUNTRY):def_init_(self, name, capital): super ( )._init_(name)self.capital = capital
Question 5:Write a class DISTRICT in Python with following specification:Instance Attributes– Dcode # Numeric value– DName # String value– People # Numeric value for Population– Area # Numeric value– Density # Numeric value for Population DensityAnswer:Class DISTRICT ( ) :def_init_(self, Dcode, DName, People, Area, Density):self.Dcode = Dcodeself.DName = DNameself.People = Peopleself. Area = Areaself.Density = DensityDef display (self):print (“District Code”, self.Dcode)printf (“District Name”, self.Dname)printf (“Population”, self.people)printf (“Area”, self.Area)printf (“Density”, self.Denstity)
Question 6:Answer the question (i) to (iv) based on the following:Class Shop (object):Class shop_(self) :self . no_of _employees = 0self. no_of _brands= 0def getSdate (self) :self. no_of_employees=input(“Number of employees”)self.no_of_brands=input(”Number of brands”)def showSdate (self) :Print self.no of employeesPrint self.no of brands class Brand (object) :def init_(self) :self.name = ” ”self.category=(“Mens”, “Womens”, “Kids”)self.avgprice=0, 0def getdate (self) :self.name = raw_input(“Enter Brand Name”)self.avgprice = input(”Enter Average Price”)def showdate (self) :Print self, namePrint self, categoryPrint self, avgpriceClass Mall (Brand, Shop) :def showdate (self) :self.no of shops = 0def getdate (self) :super (mall, self).getSdate ( ) # Statementsuper (mall, self).getdate ( ) # Statement 2self.no_of_shops=input (“Enter number of shops”)def showdata(self)print self.no_of_shopsprint self.no of brands # Blank 1
Which type of inheritance is demonstrated in the above code?
Explain Statement 1 and 2.
Name the methods that are overridden along with their class name.
Fill Blank 1 with a statement to display variable category of class Brand.
Answer:
Multiple Inheritance
Statement 1 and 2 invoke the getSdate() function of class shop and getData() function of class Brand respectively.
getdata() method of class Brand is overridden. When object of class Mall is created.M=Mall ( )k.getdata ( )getdate( ) methodof class Mall is invoked and not of class Brand is called.
print Brand ( ). category
TOPIC-2ClassesShort Answer Type Questions (2 marks)
Question 1:Give one word for the following:a. A sort of constructor in Python ______b. A region of a Python program where a namespace is directly accessible.______c. It returns the docstring of a class.______d. It returns the string representation of the object. ______e. A method used to delete an attribute. ______Answer:a. _init_b. scopec. _doc_d. _str_e. _delattr_ ()
Question 2:Define a namespace. Give examples of namespaces with respect to Python.Answer:Namespace is a mapping from names to objects. Examples of namespaces are built-in names, global names in a module and local names in function invocation.
Question 3:What is the significance of super method? Give on example of the same.Answer:super ( ) function is used to call base class methods which has been extended in derived class.Example :class GradStudent (Student):def_ init _(self) :super (GradStudent, self). _init _( )self. subject = ” ”self. working = ” ”def readGrad (self) :# Call readStudent method of parent class super (GradStudent, self). readStudent ( )
Question 4:Explain LEGB rule.Answer:LEGB rule: when a name is encountered during the execution of the program , it searches for that name in the following order:L. Local – It first makes a local search, i.e. in current def statement.E. Enclosing functions – It searches in all enclosing functions, form inner to outer.G. Global (module) – It searches for global modules or for names declared globalB. Built-in (Python) – Finally it checks for any built in functions in Python.
Question 5:Is object of a class mutable? Why/why not?Answer:User classes are considered mutable. Python doesn’t have (absolutely) private attributes, so you can always change a class.
Question 6:Explain the usage of keyword ‘pass’ in class definition.Answer:When a class doesn’t define any methods or attributes, but syntactically, there needs to be something in the definition, so we use pass. It is a statement that does nothing, and is a good placeholder when you are stubbing out functions or classes.
Question 7:What is the use of _init_ ? When is it called? Explain with an example.Answer:
_init_ help to create objects and instances to the parent class.
It reserve the memory to the members of the class.
Question 8:Explain the importance of self in Python classes.Answer:self is an object reference to the object itself, therefore, they are same. Python methods are not called in the context of the object itself, self in Python may be used to deal with custom object models.
Question 9:Differentiate between class attributes and instance attributes.Answer:The difference is that the attribute on the class is shared by all instances. The attribute on an instance is unique to that instance.
Question 10:Explain _str_ with an example.Answer:_str_ , returns a string representation of a Point object. If a class provides a method named _str_ , it overrides the default behavior of the Python built-in _str_ function.>>> p = Point(3, 4)>>> str(p)‘(3,4)’Printing a Point object implicitly invokes _str_ on the object, so*- defining _str_ also changes the behavior of print:>>> p = Point(3,4)>>> print p(3,4)
Question 11:What do you mean by name mangling? Support your answer with relevant example.Answer:Name mangling of the double underscore makes the most sense for achieving “private-ness”. Now when a function is called from the ‘self’ instanceand it notices that it starts with ‘_’, it just performs the name mangling right there. Name mangling is helpful for letting sub-classes override methods without breaking intra class method calls.
Question 12:Differentiate between reference counting and automatic garbage collection with respect to Python.Answer:Reference counting works by counting the number of times an object is referenced by other objects in the system. Python’s garbage collector runs during program execution and is triggered when an object’s reference count reaches zero. An object’s reference count changes as the number of aliases that point to it change. An object’s reference count increases when it is assigned a new name or placed in a container (list, tuple or dictionary). The object’s reference count decreases when it is deleted with del, its reference is reassigned, or its reference goes out of scope. When an object’s reference count reaches zero, Python collects it automatically.Automatic garbage collectiomPython deletes the objects which are not required, may it be built-in types or class instances, through the process named garbage collection. When the number of allocations minus the number of de-allocations are greater than the threshold number, the garbage collector is run and the unused block of memory is reclaimed.One can inspect the threshold for new objects by loading the garbage collector (gc) module and asking for garbage collection thresholds.
Question 13:Predict the output of the following code snippet:ptr=40def result():print ptrptr=90def func(var):if var<=60:ptr=30print ptrresult()func(60)func(70)Answer:UnboundLocalError: local variable ‘ptr’ referenced before assignment.
Question 14:What is the difference between Multilevel inheritance and multiple inheritance? Give suitable examples to illustrate.Answer:
Question 15:How do you implement abstract method in Python? Give an example for the same.Answer:Abstract method : An unimplemented method is an abstract method. When an abstract method is declared in a base class, the drived class has to either difine the method or raise” Nothlmplemented Error”class Shape (object):def findArea (self):passclass Square (Shape):def_ init_(self, side):self, side = sidedef find Area (self):return self.side*self.sideNote: We can use @ abstract method to enable parent class method to be executed.
Question 16:Predict the output of the following code snippet:ptr=50def result():global ptrptr=ptr+1print ptr result()print ptrAnswer:5151
Question 17:Name the methods that can be used to:
access attribute of an object
delete an attribute of an object
Answer:
getattr(obj, name[, default])
delattr(obj, name)
Question 18:Give the statement to:
Check whether the attribute str exists in the class Test whose object is T
Assign a value “Hello” to the attribute str of class Test and object Tl.
Answer:
hasattr (Tl,str)
setattr (Tl, str, “Hello”)
Question 19:Predict the output of the following code:class Match:#“Runs and Wickets”runs=281wickets=5def init (self,runs, wickets) :self.runs=runsself.wickets=wicketsprint “Runs scored are :” ,runsprint “Wickets taken are :” .wicketsprint “Test. do :”, Match. docprint “Test._name_ , Match. _name_print “Test_module_ , Match.__module_print “Test. _bases_ , Match._bases_print “Test._dict_ , Match. _diet_Answer:Runs scored are : 281Wickets taken are : 5Test._ do_ : NoneTest._name_ : MatchTest._module_ : mainTest._bases_ : ()Test. _diet_ : {‘ _module _’: ‘_ main_ ’, ‘_doc _’: None, ‘runs’: 281, ‘_init_ ’:<function _init_ at 0x0000000002DDFBA8>, ‘wickets’: 5}
Long Answer Type Questions (4 marks)
Question 1:Write a class customer in Python Containing Deduct % Mark to be deducted if caldiscount () is following specifications. not invoked properly
Instance attributes: inside input( ) functioncustomernumber – numeric value No mark to be deducted if member functioncustomemame – string value definitions are written inside the class
price, qty discount, totalprice, netprice – numeric valuemethods : 
init()-To assign initial values of customernumber as 111, customemame as “Leena”, qty as 0 and price, discount & netprice as 0.
caldiscount ( ) – To calculate discount, totalprice and netpricetotalprice = price * qty
discount is 25% of totalprice, if totalprice >=50000
discount 15% of totalprice, if totalprice >=25000 and totalprice <50000
discount 10% of totalprice, if totalprice <250000netprice= totalprice – discount
input()-to read data members customer- name, customernumber, price, qty and call caldiscount() to calculate discount, totalprice and netprice.
show( ) – to display Customer details.
Answer:
class customer:def _init_(self):self.customemumber=111self.customemame=‘Leena’self.qty=0self.price=0self.discount=0self.netprice=0def caldiscount(self):totalprice = self.price*self.qtyif totalprice >= 50000:self.discount=totalprice * 0.25elif totalprice >= 25000:self.discount = totalprice * 0.15 else:self.discount = totalprice * 0.10self.netprice = totalprice – self.discountdef input(self):self.customernumber=input(“Enter Customer Number”)self.customemame = raw_input(“Enter Customer Name”)self.qty = input(“Enter Quantity”)self.price = input(“Enter Price”)self.caldiscount()def show(self):print “Customer Number”,self.customernumberprint “Customer Name”,self.customemameprint “Quantity”,self.quanti-typrint “Price”,self.priceprint “Discount”,self.discountprint “Net price”,self.netpricec = customer()c.inputO c.show()
Question 2:Create the class SOCIETY with following information:society_name,house_no,no_of_members,flat, incomeMethods :
An _init_ method to assign initial valuesof society_name as “Surya Apartments”, flat as “AType”, house_.no as 20, no_of_ members as 3, income as 25000.
Inputdata()-To read data members(society,house_no,no_of members & income) and call allocate_flat().
allocate_flat( )-To allocate flat according to income
ShowData() to display the details of the entire class.
Answer:class SOCIETY:# constructor to create an objectdef init (self):#constructorself. society_name=‘Surya Apartments’self.house_no=20self.no_of_members=3self.flat=AType’self.income=25000def Inputdata(self):self. society_name = raw_input (“Enter Society Name”)self.house_no=input(“Enter House Number”)self.no_of_members = input (“Enter No. of members”)self.income = float(raw_input (“Enter income”))def Allocate_Flat(self):if self.income >= 25000:self.flat = AType’elif self.income >= 20000 and self.income < 25000 :self.flat = ‘BTÿpe’ else:self.flat = ‘CType’def Showdata(self):print “Society Name”,self.society_nameprint “House_No”,self.house_no print “No.of members”,self.no_of mem-bersprint “Flat Type”,self.flat print “Income”,self.incomeS = SOCIETY))S.InputdataOS.Allocate_Flat()S.ShowdataO
Question 3:Define a class ITEMINFO in Python with the following description:ICode (Item Code), Item (Item Name), Price (Price of each item), Qty (quantity in stock)Discount (Discount percentage on the item), Netprice (Final Price)Methods
A member function FindDisc( ) to calculate discount as per the following rules:If Qty< = 10Discount is 0If Qty (11 to 20)Discount is 15If Qty > =20Discount is 20
A constructor init method) to assign the value with 0 for ICode, Price, Qty, Netprice and Discountand null for Item respectively
A function Buy( ) to allow user to enter values for ICode, Item, Price, Qty and call function FindDisc( )to calculate the discount and N etprice(Price * Qty-Discount).
A Function ShowAll( ) to allow user to view the content of all the data members.
Answer:class ITEMINFO:#constructor to create an .objectdef_init_(self):#constructorself.ICode=0self.Item=‘ ’self.Price=0.0self.Qty=‘ ’self.Discount=0self.Netprice=0.0def Buy(self):self.ICode=input(“Enter Item Code”)self. Item=raw_input(“Enter Item Name”)self.Price=float(raw_input(“Enter Price”))self.Qty=input(“Enter Quantity”)def FindDisc(self):if self.Qty <= 10:self.Discount = 0elif self.Qty >= 11 and self.Qty < 20 :self.Discount = 15else:self.Discount = 20self.Netprice= (self.Price*self.Qty)self.Discountdef ShowAll(self):print “Item Code’’,self.ICodeprint “Item Name”,self.Itemprint “Price”,self.Priceprint “Quantity”,self.Qtyprint “NetPrice”,self.NetpriceI = ITEMINFO()I.Buy()I.FindDisc()I. Show All ()
Question 4:Define a class PRODUCT in Python with the following specifications :Data members:Pid – A string to store product.Pname -A string to store tha name of the product. Peostprice – A decimal to store the cost price of the productPsellingprice – A decimal to store Selling Price Margin- A decimal to be calculated as Psellingprice- PcostpriceRemarks- To store “Profit” if Margin is positive else “Loss’ if Margin is negativeMember Functions :
A constructor to intialize All the data members with valid default values.
A method SetRemarks() that assigns Margin as Psellingprice – Peostprice and sets Remarks as mentioned below :
A method Getdetails() to accept values for Pid. Pname,Psellingprice and invokes SetRemarks() method.
A method Setdetails () that displays all the data members.
Answer:class PRODUCT:def init (self):self. Pid = self. Pname = self. Peostprice = 0.0 self. Psellingprice = 0.0 self. Margin = 0.0 self. Remarks = def SetRemarks (self) :self . Margin = self.Psellinrprice-self. Peostpriceif (self.Margin < 0) :self. Ramarks = “Loss”else:self. Remarks = “Profit” defGetdetails (self):self.Pid = rawjnput (“Enter Product Id”)self.Pname = rawjnput (“Enter Product Name”)self.Peostprice = input (“Enter Cost Price”)self.Psellingprice = input (“Enter Selling Price”)self. SetRemarks ( ) def Setdateils (self) :print “Product Id” ,self.Pid print “Product Name”,self.Pname print “Cost Price”,self.Pcostprice print “Selling Price”,self.Esellingprice print “Margin : ” ,self.Margin print “Incurred :” ,self.Remarks
Question 5:Write a Python program using classes and objects to simulate result preparation system for 20 students. The data available for each student includes: Name, Rollno, and Marks in 3 subjects. The percentage marks and grade are to be calculated from the following information:Also demonstrate constructor overloading.Answer:# constructor to create an objectdef init (self,s=None):#non-copy constructor if s==None:self.rollno = 0 self.name = ‘ ’self.marks = [0,0,0]self.avg = 0.0 self.grade = ‘ ’# copy constructor else:self.rollno = s.rollno self.name = s.name self.marks = s.marks self.avg = s.avgself.grade = s.gradedef read (self):# This function gets the details of a student from the userselfrollno=iaw_input(“Enter roll number.-’)self.name = raw_input(“Enter name:-”) s=0for i in range(0,3):self.marks [i] = int(r a w_input (“Enter the marks ?”)) s = s + self.marksfi] self.avg = s/3if(self.avg>60):self.grade=‘A’elif self.avg>40:self.grade=‘B’else:self.grade=‘C’def display (self):# This function prints each student’s detailsprint self.rollno,“\t”, self, name, “\t\ t”,self.grade s = StudentO studlist = []num = int(raw_input(“Enter no. of students:-’’))for i in range(O.num):s.read()studlist. append(Student(s))print “ STUDENT REPORT \n”print “***********************************\n”print “RollNo \t Name \t\t Grade”print “*******************************************\n”for i in range(0,num):studlist[i] .displayO#Initialize avg as the first student’s avg maxavg = studlist[0].avg totavg = 0for i in range(l.num):totavg = totavg + studlist[i].avg if studlist[i].avg > maxavg: maxavg = studlist[i].avg topper = studlist[i].name totavg = totavg/numprint “Class topper is”,studlist[i],name,“with average”, studlist [i]. avgprint “Class average is”,totavgclass Student:
Question 6:Define a class SUPPLY in Python with the following description:Private Members Code of type int FoodName of type string FoodType of type string Sticker of type stringA member function GetType() to assign the following values for Food Type as per the given Sticker
A function Foodln() to allow user to enter values for Code, EoodName, Sticker and call function GetType() to assign respective FoodType.
A function FoodOut() to allow user to view the contents of all the data members.
Answer:class SUPPLY:• constructor to create an objectdef init (self) :#constructorself.FoodCode=()self.FoodName=‘ ’self.FoodType=‘ ’self.Sticker=‘ ’def Foodln(self):self.FoodCode=input(“Enter Food Code”)self.FoodName=raw_input(“Enter Food Name”)self.Sticker=raw_input(“Enter Sticker Colour”)def GetType(self):if self.Sticker==‘GREEN’:self.FoodType = ‘Vegetarian’elif self.Sticker==’YELLOW’:self.FoodType = ‘Contains Egg’elif self.Sticker==‘RED’:self.FoodType = ‘Non-Vegetarian’ else:self.FoodType = ‘Not Known’def FoodOut(self):print “FoodCode’’,self.FoodCodeprint “FoodName”,self.FoodNameprint “FoodType”,self.FoodTypeprint “Sticker”,self.StickerS = SUPPLY()S.FoodIn()S.GetTÿpe()S.FoodOut()
TOPIC-3InheritanceVery Short Answer Type Questions (1 mark)
Question 1:Give one example for an abstract method.Answer:An abstract method is a method declared in a parent class, but not implemented in it. The implementation of such a method can be given in the derived class, class circle(object):def getradius(self):
Question 2:Define the term inheritance.Answer:Inheritance is a mechanism in which a new class is derived from an already defined class. The derived class is known as a subclass or a child class. The pre-existing class is known as base class or a parent class or a super class. The mechanism of inheritance gives rise to hierarchy in classes. The major purpose of inheriting a base class into one or more derived class is code reuse. The subclass inherits all the methods and properties of the super class.
Question 3:What is single inheritance?Answer:In single inheritance a subclass is derived from a single base class.
Question 4:What is multiple inheritance? Explain with an example.Answer:In this type of inheritance, the derived class inherits from one or more base classes. In the figure below, X and Y are the base classes while Z is the derived class.
Question 5:Give one example of multilevel inheritance.Answer:In multilevel inheritance, the derived class becomes the base of another class.For example, Country is the base class of State and City is the derived class of State.
Short Answer Type Questions (2 marks)
Question 1:Based on the diagram, answer the following:
Write the name of the base class and the derived classes.
Write the type of inheritance depicted in the above diagram.
Answer:
Base class – Furniture; Derived classes – Sofa & Cot
Hierarchical inheritance
Question 2:Explain the concept of overriding methods.Answer:Overriding is a very important part of OOB since it is the feature that makes inheritance exploit its full power. Through method overriding, a class may “copy” another class, avoiding duplicated code, and at the same time enhance or customize part of it.
Question 3:Based on the diagram, answer the following:
Write the name of the base class and derived class of state.
Write the type of inheritance depicted in the diagram.
Answer:
Base class of state – CountryDerived class of state – City
Multilevel inheritance
Question 4:What are the different ways of overriding function call in derived class of python? Illustrate with example.Answer:Overriding enables the programmer to provide specific implementation to a method in the derived class. So, the method invoked depends on the object used to invoke it. If base class object is used then base class version of the method is called else the derived class method is called, class Parent:def func(self):print ‘Parent method’ class child:def func(self):print ‘child method’C = child()c.func() # child calls overridden method
Question 5:How do we implement abstract method in Python?Support your answer with an example.Answer:An abstract method is a method defined in a base class, but that may not provide any implementation. It is done by using the abc module in Python, import abcclass Shape(object):metaclass = [email protected] method_to_implement(self, input):“’’’’Method documentationreturn
Question 6:Find the output of the following code and write the type of inheritance:p=Gstudent(‘Mona’, 20,12, $9, ‘computer’)def_init_(self, name, age, roll no, marks, stream):super (Gstudent, self) _init_(name, age, roll no, marks)self stream=streamdef display 2 (self):self display()print “stream:”,self.stream P=Gstudent (‘Mona’, 20,12, 99, ‘Computer’)p.display2()Answer:TVpe of inheritance: Multilevel Output:Name : MonaAge : 20Roll No: 12Marks : 99stream: computer
Question 7:Rewrite the following code after removing errors. Underline each correction and write the output after correcting the code:class First():def _init_ (self):print “first”:class Second(object):def _init_ (self):print “second” class Third(First, Second):def _init_ (self):First. _init_ (self):Second. _init_ (self):print “that’s it”t=Third()t=Third()Answer:class First():def _init_ (self):print “first”class Second(object):def_ init_(self):print “second” class Third(First, Second):def _init_ (self):First._init_ (self)Second._init_(self)print “that’s it”t=Third()t=Third()
Question 8:Complete the following code:class employee(object):def _init_(self,no,name,age):self.no=noself.name=___ #complete the statementself.age= ___ #complete the statementdef printval(self):print “Number:”,self.no print “Name :”,self.name print “Age :”,self.age class pay(object):def _init_ (self,dept,salary): #completethe definition__________________def display(self): #complete the definition______ # call printval()______ # print dept______ # print salaryAnswer:class employee (object):def init (self,no,name,age):self.no=noself.name=nameself.age=agedef printval(self):print “Number:”,self.no print “Name :”,self.nameprint “Age :’’,self.ageclass pay(object):def _init_ (self,dept,salary):self.dept =deptself.salary=salarydef display(self)self.printval()print self.deptprint self.salary
Long Answer Type Questions (4 marks)
Question 1:Write a Python program to demonstrate multiple inheritance. Consider 3 classes with the following description.Student class has 3 protected data members roll number, markl and mark2 of type integer. It has a get() function to get these details from the user. Sports class has a protected data member sports marks of type integer and a function getsm() to get the sports mark.Statement class uses the marks from Student class and the sports marks from the Sports class to calculate the total and average and displays the final resultAnswer:class student(object):# constructor to create an object def init (self):self.mo=0self.m1=0self.m2=0def get(self):self.mo=int(raw_input(“Enter the Roll no:”))print “Enter 2 marks”self.m1=int(raw_input(“Markl?”))self.m2=int(raw_input(“Mark2 ?”))classsports(object):# Sports markdef_init_(self):self.sm=0def getsm(self):self.sm=int(raw_input(“Enter the sports mark:”))class statement(student,sports):def_init_(self):super(statement,self)._init_()def display (self):tot=(self.ml+self.m2+self.sm); avg=tot/3;print“\n\n\tRoll No. : ”,self.mo,“\n\tTotal :”,tot print“\tAverage : ”,avgobj=statement()obj.get()obj.getsm()obj. display()
Question 2:SKP Hotel offers accommodation, meals facilities.Create a class Accommodation with Room Number, type of room, and rent, etc..Create a class meals services includes: meals code, name, price, etc..Create a class customer with customer number, name, address, etc.Customer class is derived by using Accommodation and meals classes.Answer:class Accommodation(object):# constructor to create an objectdef_init_(self):self.roomno=0self.roomtype=”self.roomrent=0.0defgetroom(self):self.roomno=input(“Enter the Room no:”)self.roomtype=rawjnput(“Enter the Room type:’)self.roomrent=float(raw_input(“Enter Room Rent”))class Meals(object):# Meals classdef_init_(self):self.mealcode=0self.mealname=“”self.mealprice=0.0def getmeals(self):self.mealcode=input(“Enter the meal code:”)self.mealname=raw_input(“Enter the meal name:”)self.mealprice=float(raw_input(“Enter the meal price”))class Customer(Accommodation,Meals):def_init_(self):super(Customer,self)._init_()self.custnum=0self.custname=‘ ’self.address=‘ ’def getCustomer(self):self.custnum=input(“Enter the customer number”)self.custname=raw_input(“Enter customer name”)self. address=raw _input(“Enter customer address”)def displaybill(self):print“Customer Name:”,self.custname,“Address:”, self, addressprint“Room No:”,self.roomno,“Room Type:”,self.roomtype,“Room Rent: Rs’jself.roomrentprint“Meal Name:”,self.mealname,“Price:”,self.mealpriceprint“Total Amount Due:”,self.roomrent+ self.mealpriceobj=Customer()obj.getCustomer()obj.getroom()obj.getmeals()obj.displaybill()
Question 3:Pay roll information system:Declare the base class ’employee’ with employee’s number, name, designation, address, phone number. Define and declare the function getdata() and putdata() to get the employee’s details and print employee’s details. Declare the derived class salary with basic pay, DA, HRA, Gross pay, PF, Income tax and Net pay. Declare and define the function getdatal() to call getdata() and get the basic pay. Define the function calculate() to find the net pay. Define the function display() to call putdata() and display salary details .Create the derived class object. Read the number of employees. Call the function getdatal)) and calculate() to each employees. Call the display() function.Answer:class employee (object):# constructor to create an objectdef init (self):self.eno=0self.name=‘ ’self.designation=‘ ’self.address = ‘ ’self.phonenumber=0def getdata(self):self.eno=input(“Enter Employee Number”)self.name=raw_input(“Enter Employee Name’)self.designation=raw_input(“Enter Employee Designation”)self.address = raw_input(“Enter Employee Address”)self.phonenumber=input(“Enter Employee Phone Number”)def putdata (self):print “Employee Number”,self.enoprint “Employee Name”,self.nameprint “Employee Designation”,self.designationprint “Employee Address”,self.addressprint “Employee Phone Number”,self phonenumberclass salary (employee):# Salary detailsdef_init_(self):super(salaryself)._init_()self.basic=0self.DA=0self.HRA=0self.Gross=0self.PF=0self.tax=0self.netpay=0def getdatal(self): self.getdata()self.basic=float(raw_input(“Enter the basic pay’’))self.DA=float(raw_input(“Enter the DA”))self.HRA=float(raw_input(“Enter the HRA))self.PF = float(raw_input(“Enter the PF”))def calculate(self):self.Gross= self.basic + self.FîRA + self.DAif .self. Gross < 100000:self.tax=0elif self.Gross < 500000:self.tax=self.Gross*0.10elif self.Gross < 1000000:self.tax=self.Gross*0.15else:self.tax=self.Gross*0.20self.netpay= self.Gross – self.PF – self.taxdef display(self):self.putdataOprint “Gross Income”,self.Grossprint “Tax “,self.taxprint “Net Income”,self.netpaysalaryobj =salary()num = int(raw_input(“Enter no. of employees:-”))for i in range(0,num):salaryobj.getdatal()salaryobj.calculate()salaryobj.display()
Question 4:Define a class employee in Python with the given specifications:Instance variables:Employee number, name Methods:Getdata()- To input employee number and namePrintdata()- To display employee number and nameDefine another class payroll, which is derived from employeeInstance variable Methods:Inputdata() – To call Getdata() and input salary.Outdata() – To call Printdata() and to display salary.Define another class leave, which is derived from payroll.Instance variable No of days Methods:acceptdata() – To call Inputdata() and input no of days.showdata() – To call Outdata() and to display no of days.Implement the above program in python.Answer:class Employee(object):# constructor to create an objectdef_init_(self):self.eno=0self.name=“”def Getdata(self):self.eno=input(“Enter the Employee no:”)self.name= raw_input(“Enter the Employee Name:”)def Printdata(self):print “Employee Number”,self.eno print “Employee Name”,self.nameclass payroll(Employee):def_init_(self):super(payroll,self). _init_()self.salary=0def Inputdata(self): self.GetdataQself.salary=float(raw_input(“Enter the salary:”))def Outdata(self): self.Printdata()print “Salary is”,self.salaryclass leave(payroll):def_init_(self):super(leave,self)._init_()self.Noofdays=0 def acceptdata(self):self.Inputdata()self.Noofdays =input(“Enter leave days”)def showdata(self): self.Outdata()print “No. of leave days”,self.Noofdays leaveobj = leave()leaveobj. acceptdataOleaveobj.showdata()
Question 5: What output will be generated when the following Python code is executed?def changeList () :L = []LI = [ ]L2 = []for i in range (10,1, -2) :LI append (i)for i in range (len ( LI)) :L2. append (LI [i] + L [i] )print L2ChangeList ( )Answer:[11, 10,9, 8, 7,4]
via Blogger https://ift.tt/3hs8vzC
0 notes
kitwallace · 6 years
Text
Tessellations
Any number of interlocking tilings can be formed by the techniques of perimeter modification which have been developed in the field of Escher-style pictorial tessellations. 
There is a vast body of work on tesselations eg:
http://mathstat.slu.edu/escher/index.php/Tessellations_by_Other_Figures
http://en.tessellations-nicolas.com/method.php
http://www.tess-elation.co.uk/
http://tessellation.info/en
http://www.tessellations.org/
https://twitter.com/hashtag/tessellation
OpenSCAD
Here are some of the techniques applied with OpenSCAD.  Of course the real challenge is to create pictorially interesting tessellations, of which Escher is still the master.  
1.  rectangular - opposite sides   
Tiling unit is a single tile
Tumblr media
This simple technique is commonly used in beginner exercises eg
      https://www.math.nmsu.edu/~pmorandi/math112f00/EscherRectangle.html
      http://www.tessellations.org/methods-diy-papercut.shtml
The graphical technique starts with a rectangle, then replaces one side with an arbitrary curve, traces and copies that side to the opposite side and repeats for the other pair of sides.  The openSCAD code does likewise, except that copying the modified side, expressed as a sequence of  [length,angle] pairs, requires reversing and mirroring this sequence.
use <tile_fns.scad>
p_base=repeat([[10,90]],4);
side1 = [[2,300],[1,120],[1,120],[1,60],[1,240],[1,240],[1,120],[1,240],[1,300],[1,60],[2,90]]; side2= [[2,240],[1,120],[1,120],[1,240],[2,90]];
p_tessa =    replace_sides(p_base,[side1,side2,rmirror_side(side1),rmirror_side(side2)]);
t_tessa=peri_to_tile(p_tessa);
fill_tile(t_tessa);
replace_sides () replaces each base side with the corresponding modified side, scaled to fit and with a matching final angle.
More generally the base can be a parallelogram:
Tumblr media
To effect tiling, the script computes the translation vectors in two directions . In this simple case, with sides number 0 (bottom) to 3 (left),  one direction matches side 3 to side 1 (a translation in the X direction) and the other matches side 0 to side 2 in the ‘Y’ direction.  
rectangular - adjacent sides
Square base only.  A single tile doesn't tile. We need to create a tiling unit consisting of four rotated tiles eg:
Tumblr media
Tiling units are created by matching sides, eg to put the blue tile next to the red tile , we match side 1 to side 2  (the two matching sides) and similarly for the other tiles to create the unit. 
Tiling units are not unique - note that the 4 sides around a vertex are the same, so we can choose any vertex e.g.
Tumblr media
Computing the translations uses matching sides but now the sides may be on different tiles in the unit.
Tumblr media
hexagonal - opposite 
Tiling unit is a single tile
Tumblr media
hexagonal - adjacent   
tiling unit is three tiles eg:
Tumblr media Tumblr media
Midpoint rotation  on different opposing sides of a parallelogram
Tiling unit is two tiles:
Tumblr media Tumblr media
triangular - midpoint rotation of each side   
unit is a pair of tiles  eg:
Tumblr media Tumblr media
Triangles do not need to be equilateral.  
Tumblr media
We can also create mirror symmetrical tiles  
with a single tiling unit
Tumblr media
Slightly pleased with my last, accidental design!
OpenSCAD Code in Github
Still to do:  a comprehensive coverage of tessellation approaches and an easy way to convert a drawn curve to a perimeter.
0 notes
alphaplus052things · 6 years
Photo
Tumblr media
4月15日発売予定‼︎ DJ Yuma Ride Vol.140 ¥1,000+tax Ride第140弾 今月も最新Hip Hop, R&Bをいち早くお届け! GrooveMixで終始鳥肌モノ! 日本で一番人気の新譜MixCDそれが”Ride”! 今月もお聴き逃しなく!! #03/先日来日したRae Sremmurdの最新作!名曲Three6Mafia/Side2 Sideをサンプリング!当時流行ったハイハット使いが懐かしい! #11/West CoastのレジェンドDaz Dillingerの最新アルバムからの一曲! 西海岸サウンド全開!これもClassics決定でしょ! #21/ジニアスラッパーLogicとMarshmelloのコラボ!分かりやすいサビ とキャッチーなトラック!爆音で聴きたいです! #29/Khalidの声は聴くほど癖になります!Fifth HarmonyのNormaniとの デュエットは最高です!じっくり聴いてください! 01.Trouble ft Quavo & Fetty Wap/Rider 02.2 Chainz ft YG & Offset/Proud 03.Rae Sremmurd ft Juicy J/Powerglide 04.Trina ft Rick Ross/Barking 05.YBN Nahmir/Bounce Out With That 06.Rich The Kid/Plug Walk 07.Saweetie/Icy Grl 08.Iggy Azalea ft Quavo/Savior 09.Lil Dicky ft Chris Brown/Freaky Friday 10.Baby Bash ft Frankie J & Baeza/Rush 11.Daz Dillinger/West Coast 12.Ncredible Gang ft DJ Luke Nasty, Nick Cannon & Fat Joe/Only You 13.DJ Nasty 305 ft Tory Lanez, Ballgreezy, Mike Smiff & Litty Lamb/I Like 14.Swae Lee ft Rae Sremmurd/Hurt To Look 15.Tory Lanez/Hypnotized 16.Towkio ft Teddy Jackson & Grace Weber/2 Da Moon 17.Tuxedo/Shy 18.DJ Luke Nasty/Me Time 19.Kyle ft Kehlani/Playinwitme 20.24hrs ft Lil Pump/Lie Detector 21.Logic & Marshmello/Everyday 22.Lil Yachty ft Trippie Redd/66 23.XXXtentacion/Sad 24.Jeremih/Cards Right 25.Post Malone ft Ty Dolla $ign/Psycho 26.A CHAL ft 2 Chainz & Nicky Jam/Love N Hennessy (Remix) 27.Kodak Black ft Khalid/I Be On The Way 28.Tinashe ft Offset/No Drama 29.Khalid & Normani/Love Lies 30.Amine ft Kehlani/Heebeejeebies 31.SZA/Broken Clocks 32.DaniLeigh ft Kes/All I Know
0 notes
margdarsanme · 4 years
Text
NCERT Class 12 Computer Science Chapter 2 Object Oriented Programming Concepts
NCERT Class 12 Computer Science Python Solutions for Chapter 2 :: Object Oriented Programming Concepts
 TOPIC-1
General OOP ConceptsShort Answer Type Questions (2 marks)
Question 1:How is a static method different from an instance method?Answer:Static method has to be defined outside a class. It can be called without an object.Instance method is defined within a class and has to be invoked on an object.
Question 2:Explain Data Hiding with respect to OOP.Answer:Data hiding can be defined as the mechanism of hiding the data of a class from the outside world or to be precise, from other classes. Data hiding is achieved by making the members of the class private. Access to private members is restricted and is only available to the member functions of the same class. However the public part of the object is accessible outside the class.
Question 3:Fill in the blanks:
Act of representing essential features without background detail is called ______ .
Wrapping up of data and associated functions into a single unit is called ______ .
______ is called the instance of a class.
Answer:
Data Abstraction
Encapsulation
Object
Question 4:What is Object Oriented Programming? List some of its advantages.Answer:OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. Advantages:
Simplicity
Modifiability
Extensibility and Maintainability
Reusability
Security
Question 5:Differentiate between an object and a class.Answer:A class is a collection of objects of similar type.For example, mango, apple and orange are members of the class fruit. Classes are user-defined data types and behave like the built-in types of a programming language.The syntax used to create an object is not different than the syntax used to create an integer object in C. If fruit has been defined as a class, then the statement fruit mango; will create an object mango belonging to the class fruit.
Question 6:Explain polymorphism with an example.Answer:Polymorphism is the ability for a message or data to be processed in more than one form. An operation may exhibit different behaviors in different instances. For example, consider the operation of addition of two numbers, the operation will generate a sum. If the operands are strings, then the operation would produce a third string by concatenation.
Question 7:List three features that make an important charac-teristic of OOP.Answer:
Capability to express closeness with the real- world models.
Reusability-allows addition of new features to an existing one.
Transitivity-changes in one class get automatically reflected across.
Question 8:How do we implement abstract method in python? Give an example for the same.Answer:Abstract method : An unimplement method is called an abstract method. When an abstract medhod is declared in a base class the derived class has to define the method or raise “Notimplemented Error”
Or
Abstract Method can be used to enable parent class method execution.Class Shape (object):def findArea (self): passClass Square (Shape):def init (self, side):self, side = side def findArea self.side*self.side
Question 9:List few disadvantages of OOP.Answer:
Classes tend to be overly generalized.
Relationship among classes might become artificial.
Program design is tricky and complicated.
More skills and thinking in terms of objects is required.
Question 10:Explain Function overloading with an example.Answer:When several function declarations are specified for a single function name in the same scope, the function is said to be overloaded. In other languages, the same function name can be used to define multiple functions with different number and type of arguments, def test(): #function 1 print “hello”def test(a, b): #function 2return a+bdef test(a, b, c): #function 3return a+b+c 2
Question 11:What is inheritance? Explain with an example.Answer:Inheritance is the capability of one class to acquire the properties or capabilities of another class. For example, the bird ‘Parrot’ is a part of the class ‘Flying Bird’ which is again a part of the class ‘Bird’.
Question 12:How data encapsulation and data abstraction are implemented in Python, explain with an example.
Or
How do abstraction and encapsulation complement each other?Answer:Abstraction and Encapsulation are complementary concepts. Through encapsulation only we are able to enclose the components of the object into a single unit and separate the private and public members. It is through abstraction that only the essential behaviors of the objects are made visible to the outside world.So, we can say that encapsulation is the way to implement data abstraction. For example in class Student, only the essential information like roll no, name, date_of_birth, course, etc. of the student will be visible. The secret information like calculation of grades, allotment of examiners etc. will be hidden.
Question 13:Consider the figure given below and answer the questions that follows:
Name the base class and the derived class.
Which concept of OOP is implemented in the figure given above?
Answer:
Base class – STUDENTDerived classes – GRADUATE & POST GRADUATE
Inheritance
Question 14:What is abstract method? Give a suitable example to illustrate the same.Answer:Abstract Method: An abstract method is a method defined in the base class, but does not require code for the implementaion. e.g.,Class teacher: def entry (self):teach#=int(input(“Enter No”))def display ( ):print (self, teach #)
Question 15:What is the concept of overriding method? Give an example for the same.Answer:Overriding Methods : It is a method to access, the paramterized constructer with same name but having different parameters. For example,Class emp:def_init_(self, n):self, a = n def_init_(self):self, a = 100
Question 16:Is function overloading supported by Python? Give reasons.Answer:A given name can only be associated with one function at a time, so cannot overload a function with multiple definitions. If you define two or more functions with the same name, the last one defined is used.However, it is possible to overload a function, or otherwise genericized it. You simply need to create a dispatcher function that then dispatches to your set of corresponding functions. Another way to genericized a function is to make use of the simple generic module which lets you define simple single-dispatch generic functions.def test(): #function 1print “hello”def test(a, b): #function 2return a+bdef test(a, b, c): #function 3return a+b+cIf you run the code of three test functions, the second test() definition will overwrite the first one. Subsequently the third test() definition will overwrite the second one. That means if you give the function call test (20,20), it will flash an error stating, “Type Error: add() takes exactly 3 arguments (2 given)”. This is because, Python understands the latest definition of the function test() which takes three arguments.
Question 17:Predict the output of the following program. Also state which concept of OOP is being implemented?def sum(x,y,z):print “sum= ”, x+y+zdef sum(a,b):print “sum= ”, a+bsum(10,20)sum(10,20,30)Answer:Type Error: sum() takes exactly 3 arguments (2 given)Concept: Polymorphism [Function Overloading]
Question 18:Define binding. Differentiate between static and dynamic binding.Answer:Binding is the process of linking the function call to the function definition. The body of the function is executed when the function call is made. Binding can be of two types:Static Binding: In this type of binding, the linking of function call to the function definition is done during compilation of the program.Dynamic Binding: In this type of binding, linking of a function call to the function definition is done at run time. That means the code of the function that is to be linked with function call is unknown until it is executed.
Long Answer Type Questions (4 marks)
Question 1:Write a program that uses an area() function for the calculation of area of a triangle or a rectangle or a square. Number of sides (3, 2 or 1) suggest the shape for which the area is to be calculated.Answer:from functools import wrapsimport mathdef overloaded(func):@wraps(func)def overloaded_func(*args, **kwargs):for f in overloaded_func.overloads:try:return f(*args, **kwargs)except TÿpeError:passelse:# it will be nice if the error message prints a list of# possible signatures hereraise TÿpeError(“No compatible signatures”)def overload_with(func):overloaded_func.overloads.append(func)return overloaded_funcoverloadedjunc.overloads = [func]overloaded_func.overload_with = overload_withreturn overloaded_func
#############©overloadeddef area():print ‘Area’[email protected]_withdef _(a):# note that, like property(), the function’s name in# the “def _(n):” line can be arbitrary, the important# name is in the “@overloads(a)” lineprint ‘Area of square=’,a*apass
@area.overload_withdef _(a,b):# note that, like property(), the function’s name in# the “def _(nl,n2):” line can be arbitrary, the important t# name is in the “@overloads(a)” lineprint Area of rectangle=’,a*[email protected]_withdef _(a.b,c):s= (a+b+c)/2print sprint Area of triangle=’, math.sqrt(s*(s-a)* (s-b)*(s-c))passchoice=input(“Enter 1-square 2-rectangle 3- tr-iangle”)if choice==1:side = input(“Enter side”) area(side)elif choice ==2:length = input(“Enter length”)breadth = input(“Enter breadth”)area(length,breadth) elif choice==3:a = inputfEnter sidel”)b = inputfEnter side2”)c = inputfEnter side3”) area(a,b,c)else:print “Invalid choice”
Question 2:Write a program to find out volume of a cube, cuboid and cylinder using function overloading.Answer:from functools import wraps import math def overloaded(func):@wraps(func)def overloaded_funcfargs, **kwargs):for f in overloaded_func.overloads:try:return ff args, **kwargs)except TypeError:pass 1else:# it will be nice if the error message prints a list of# possible signatures here raiseTypeError(“No compatible signatures”)def overload_with(func):overloaded_func.overloads.append(func)return overloaded_funcoverloaded_func.overloads = [func]overloaded_func.overload_with = overload_withreturn overloaded_func #############@overloadeddef volume():print ‘Volume’[email protected]_with def _(a):print ‘Volume of cube=’,a*a*a, ‘cubic units’[email protected]_with def _(a,b):print ‘Volume of cylinder, 3.14*a*a*b,‘cubic units’[email protected]_with def _(a,b,c):print ‘Volume of cuboid=’, a*b*c, ‘cubic units’passchoice = input(“Enter 1-cube 2-cylinder 3-cuboid”)if choice==1:side = input(“Enter side”)volume (side)elif choice ==2:radius = input(“Enter radius”)height = input( “Enter height”)volume(radius,height)elif choice==3:length = input(“Enter length”)breadth = input(“Enter breadth”)height = input(“Enter height”)volume (length, breadth, height)else:print “Invalid choice”
Question 3:Write a class CITY in Python with following specification :
Code  # Numberic value
Name  # String value
Pop  # Numberic value for Population
KM  # Numberic value
Density  # Numberic value for Population DensityMethods:
CalDen ( ) # Method to calculate Density as Pop /KM
Record ( ) # Method to allow user to enter values Code, Name, Pop, KM and call CalDen ( ) method
See ( ) # Method to display all the date members also display a message “Highly Populated Area” is the Density is more than 12000.
Answer:class CITY:def _init_ (self):self. Code = 0self. Name =” ”self. Pop = 0self. KM = 0self. Density = 0def CalDen (self):self. Density = self. Pop/self. KMdef Record (self)self: Code = input (“Enter Code”)self.Name=raw_input(“Enter Name”)self. Pop = input (“Enter population”)self. KM = input (“Enter KM”)CalDen (self) // or self.CalDen ( )def See (self):print Code, name, Pop, KM, Densityif self. Density > 12000:print (“Highly Populated Area”)# OR print (“Highly populated Area”)Note : Accept self. _Cose to indicate private members
Question 4:Give a suitable example using Python code to illustrate single level inheritance considering COUNTRY to be BASE class and STATE to be derived class.Answer:Class COUNTRY: statejist = [ ]def_init_(self, name):self.name = name class state (COUNTRY):def_init_(self, name, capital): super ( )._init_(name)self.capital = capital
Question 5:Write a class DISTRICT in Python with following specification:Instance Attributes– Dcode # Numeric value– DName # String value– People # Numeric value for Population– Area # Numeric value– Density # Numeric value for Population DensityAnswer:Class DISTRICT ( ) :def_init_(self, Dcode, DName, People, Area, Density):self.Dcode = Dcodeself.DName = DNameself.People = Peopleself. Area = Areaself.Density = DensityDef display (self):print (“District Code”, self.Dcode)printf (“District Name”, self.Dname)printf (“Population”, self.people)printf (“Area”, self.Area)printf (“Density”, self.Denstity)
Question 6:Answer the question (i) to (iv) based on the following:Class Shop (object):Class shop_(self) :self . no_of _employees = 0self. no_of _brands= 0def getSdate (self) :self. no_of_employees=input(“Number of employees”)self.no_of_brands=input(”Number of brands”)def showSdate (self) :Print self.no of employeesPrint self.no of brands class Brand (object) :def init_(self) :self.name = ” ”self.category=(“Mens”, “Womens”, “Kids”)self.avgprice=0, 0def getdate (self) :self.name = raw_input(“Enter Brand Name”)self.avgprice = input(”Enter Average Price”)def showdate (self) :Print self, namePrint self, categoryPrint self, avgpriceClass Mall (Brand, Shop) :def showdate (self) :self.no of shops = 0def getdate (self) :super (mall, self).getSdate ( ) # Statementsuper (mall, self).getdate ( ) # Statement 2self.no_of_shops=input (“Enter number of shops”)def showdata(self)print self.no_of_shopsprint self.no of brands # Blank 1
Which type of inheritance is demonstrated in the above code?
Explain Statement 1 and 2.
Name the methods that are overridden along with their class name.
Fill Blank 1 with a statement to display variable category of class Brand.
Answer:
Multiple Inheritance
Statement 1 and 2 invoke the getSdate() function of class shop and getData() function of class Brand respectively.
getdata() method of class Brand is overridden. When object of class Mall is created.M=Mall ( )k.getdata ( )getdate( ) methodof class Mall is invoked and not of class Brand is called.
print Brand ( ). category
TOPIC-2ClassesShort Answer Type Questions (2 marks)
Question 1:Give one word for the following:a. A sort of constructor in Python ______b. A region of a Python program where a namespace is directly accessible.______c. It returns the docstring of a class.______d. It returns the string representation of the object. ______e. A method used to delete an attribute. ______Answer:a. _init_b. scopec. _doc_d. _str_e. _delattr_ ()
Question 2:Define a namespace. Give examples of namespaces with respect to Python.Answer:Namespace is a mapping from names to objects. Examples of namespaces are built-in names, global names in a module and local names in function invocation.
Question 3:What is the significance of super method? Give on example of the same.Answer:super ( ) function is used to call base class methods which has been extended in derived class.Example :class GradStudent (Student):def_ init _(self) :super (GradStudent, self). _init _( )self. subject = ” ”self. working = ” ”def readGrad (self) :# Call readStudent method of parent class super (GradStudent, self). readStudent ( )
Question 4:Explain LEGB rule.Answer:LEGB rule: when a name is encountered during the execution of the program , it searches for that name in the following order:L. Local – It first makes a local search, i.e. in current def statement.E. Enclosing functions – It searches in all enclosing functions, form inner to outer.G. Global (module) – It searches for global modules or for names declared globalB. Built-in (Python) – Finally it checks for any built in functions in Python.
Question 5:Is object of a class mutable? Why/why not?Answer:User classes are considered mutable. Python doesn’t have (absolutely) private attributes, so you can always change a class.
Question 6:Explain the usage of keyword ‘pass’ in class definition.Answer:When a class doesn’t define any methods or attributes, but syntactically, there needs to be something in the definition, so we use pass. It is a statement that does nothing, and is a good placeholder when you are stubbing out functions or classes.
Question 7:What is the use of _init_ ? When is it called? Explain with an example.Answer:
_init_ help to create objects and instances to the parent class.
It reserve the memory to the members of the class.
Question 8:Explain the importance of self in Python classes.Answer:self is an object reference to the object itself, therefore, they are same. Python methods are not called in the context of the object itself, self in Python may be used to deal with custom object models.
Question 9:Differentiate between class attributes and instance attributes.Answer:The difference is that the attribute on the class is shared by all instances. The attribute on an instance is unique to that instance.
Question 10:Explain _str_ with an example.Answer:_str_ , returns a string representation of a Point object. If a class provides a method named _str_ , it overrides the default behavior of the Python built-in _str_ function.>>> p = Point(3, 4)>>> str(p)‘(3,4)’Printing a Point object implicitly invokes _str_ on the object, so*- defining _str_ also changes the behavior of print:>>> p = Point(3,4)>>> print p(3,4)
Question 11:What do you mean by name mangling? Support your answer with relevant example.Answer:Name mangling of the double underscore makes the most sense for achieving “private-ness”. Now when a function is called from the ‘self’ instanceand it notices that it starts with ‘_’, it just performs the name mangling right there. Name mangling is helpful for letting sub-classes override methods without breaking intra class method calls.
Question 12:Differentiate between reference counting and automatic garbage collection with respect to Python.Answer:Reference counting works by counting the number of times an object is referenced by other objects in the system. Python’s garbage collector runs during program execution and is triggered when an object’s reference count reaches zero. An object’s reference count changes as the number of aliases that point to it change. An object’s reference count increases when it is assigned a new name or placed in a container (list, tuple or dictionary). The object’s reference count decreases when it is deleted with del, its reference is reassigned, or its reference goes out of scope. When an object’s reference count reaches zero, Python collects it automatically.Automatic garbage collectiomPython deletes the objects which are not required, may it be built-in types or class instances, through the process named garbage collection. When the number of allocations minus the number of de-allocations are greater than the threshold number, the garbage collector is run and the unused block of memory is reclaimed.One can inspect the threshold for new objects by loading the garbage collector (gc) module and asking for garbage collection thresholds.
Question 13:Predict the output of the following code snippet:ptr=40def result():print ptrptr=90def func(var):if var<=60:ptr=30print ptrresult()func(60)func(70)Answer:UnboundLocalError: local variable ‘ptr’ referenced before assignment.
Question 14:What is the difference between Multilevel inheritance and multiple inheritance? Give suitable examples to illustrate.Answer:
Question 15:How do you implement abstract method in Python? Give an example for the same.Answer:Abstract method : An unimplemented method is an abstract method. When an abstract method is declared in a base class, the drived class has to either difine the method or raise” Nothlmplemented Error”class Shape (object):def findArea (self):passclass Square (Shape):def_ init_(self, side):self, side = sidedef find Area (self):return self.side*self.sideNote: We can use @ abstract method to enable parent class method to be executed.
Question 16:Predict the output of the following code snippet:ptr=50def result():global ptrptr=ptr+1print ptr result()print ptrAnswer:5151
Question 17:Name the methods that can be used to:
access attribute of an object
delete an attribute of an object
Answer:
getattr(obj, name[, default])
delattr(obj, name)
Question 18:Give the statement to:
Check whether the attribute str exists in the class Test whose object is T
Assign a value “Hello” to the attribute str of class Test and object Tl.
Answer:
hasattr (Tl,str)
setattr (Tl, str, “Hello”)
Question 19:Predict the output of the following code:class Match:#“Runs and Wickets”runs=281wickets=5def init (self,runs, wickets) :self.runs=runsself.wickets=wicketsprint “Runs scored are :” ,runsprint “Wickets taken are :” .wicketsprint “Test. do :”, Match. docprint “Test._name_ , Match. _name_print “Test_module_ , Match.__module_print “Test. _bases_ , Match._bases_print “Test._dict_ , Match. _diet_Answer:Runs scored are : 281Wickets taken are : 5Test._ do_ : NoneTest._name_ : MatchTest._module_ : mainTest._bases_ : ()Test. _diet_ : {‘ _module _’: ‘_ main_ ’, ‘_doc _’: None, ‘runs’: 281, ‘_init_ ’:<function _init_ at 0x0000000002DDFBA8>, ‘wickets’: 5}
Long Answer Type Questions (4 marks)
Question 1:Write a class customer in Python Containing Deduct % Mark to be deducted if caldiscount () is following specifications. not invoked properly
Instance attributes: inside input( ) functioncustomernumber – numeric value No mark to be deducted if member functioncustomemame – string value definitions are written inside the class
price, qty discount, totalprice, netprice – numeric valuemethods : 
init()-To assign initial values of customernumber as 111, customemame as “Leena”, qty as 0 and price, discount & netprice as 0.
caldiscount ( ) – To calculate discount, totalprice and netpricetotalprice = price * qty
discount is 25% of totalprice, if totalprice >=50000
discount 15% of totalprice, if totalprice >=25000 and totalprice <50000
discount 10% of totalprice, if totalprice <250000netprice= totalprice – discount
input()-to read data members customer- name, customernumber, price, qty and call caldiscount() to calculate discount, totalprice and netprice.
show( ) – to display Customer details.
Answer:
class customer:def _init_(self):self.customemumber=111self.customemame=‘Leena’self.qty=0self.price=0self.discount=0self.netprice=0def caldiscount(self):totalprice = self.price*self.qtyif totalprice >= 50000:self.discount=totalprice * 0.25elif totalprice >= 25000:self.discount = totalprice * 0.15 else:self.discount = totalprice * 0.10self.netprice = totalprice – self.discountdef input(self):self.customernumber=input(“Enter Customer Number”)self.customemame = raw_input(“Enter Customer Name”)self.qty = input(“Enter Quantity”)self.price = input(“Enter Price”)self.caldiscount()def show(self):print “Customer Number”,self.customernumberprint “Customer Name”,self.customemameprint “Quantity”,self.quanti-typrint “Price”,self.priceprint “Discount”,self.discountprint “Net price”,self.netpricec = customer()c.inputO c.show()
Question 2:Create the class SOCIETY with following information:society_name,house_no,no_of_members,flat, incomeMethods :
An _init_ method to assign initial valuesof society_name as “Surya Apartments”, flat as “AType”, house_.no as 20, no_of_ members as 3, income as 25000.
Inputdata()-To read data members(society,house_no,no_of members & income) and call allocate_flat().
allocate_flat( )-To allocate flat according to income
ShowData() to display the details of the entire class.
Answer:class SOCIETY:# constructor to create an objectdef init (self):#constructorself. society_name=‘Surya Apartments’self.house_no=20self.no_of_members=3self.flat=AType’self.income=25000def Inputdata(self):self. society_name = raw_input (“Enter Society Name”)self.house_no=input(“Enter House Number”)self.no_of_members = input (“Enter No. of members”)self.income = float(raw_input (“Enter income”))def Allocate_Flat(self):if self.income >= 25000:self.flat = AType’elif self.income >= 20000 and self.income < 25000 :self.flat = ‘BTÿpe’ else:self.flat = ‘CType’def Showdata(self):print “Society Name”,self.society_nameprint “House_No”,self.house_no print “No.of members”,self.no_of mem-bersprint “Flat Type”,self.flat print “Income”,self.incomeS = SOCIETY))S.InputdataOS.Allocate_Flat()S.ShowdataO
Question 3:Define a class ITEMINFO in Python with the following description:ICode (Item Code), Item (Item Name), Price (Price of each item), Qty (quantity in stock)Discount (Discount percentage on the item), Netprice (Final Price)Methods
A member function FindDisc( ) to calculate discount as per the following rules:If Qty< = 10Discount is 0If Qty (11 to 20)Discount is 15If Qty > =20Discount is 20
A constructor init method) to assign the value with 0 for ICode, Price, Qty, Netprice and Discountand null for Item respectively
A function Buy( ) to allow user to enter values for ICode, Item, Price, Qty and call function FindDisc( )to calculate the discount and N etprice(Price * Qty-Discount).
A Function ShowAll( ) to allow user to view the content of all the data members.
Answer:class ITEMINFO:#constructor to create an .objectdef_init_(self):#constructorself.ICode=0self.Item=‘ ’self.Price=0.0self.Qty=‘ ’self.Discount=0self.Netprice=0.0def Buy(self):self.ICode=input(“Enter Item Code”)self. Item=raw_input(“Enter Item Name”)self.Price=float(raw_input(“Enter Price”))self.Qty=input(“Enter Quantity”)def FindDisc(self):if self.Qty <= 10:self.Discount = 0elif self.Qty >= 11 and self.Qty < 20 :self.Discount = 15else:self.Discount = 20self.Netprice= (self.Price*self.Qty)self.Discountdef ShowAll(self):print “Item Code’’,self.ICodeprint “Item Name”,self.Itemprint “Price”,self.Priceprint “Quantity”,self.Qtyprint “NetPrice”,self.NetpriceI = ITEMINFO()I.Buy()I.FindDisc()I. Show All ()
Question 4:Define a class PRODUCT in Python with the following specifications :Data members:Pid – A string to store product.Pname -A string to store tha name of the product. Peostprice – A decimal to store the cost price of the productPsellingprice – A decimal to store Selling Price Margin- A decimal to be calculated as Psellingprice- PcostpriceRemarks- To store “Profit” if Margin is positive else “Loss’ if Margin is negativeMember Functions :
A constructor to intialize All the data members with valid default values.
A method SetRemarks() that assigns Margin as Psellingprice – Peostprice and sets Remarks as mentioned below :
A method Getdetails() to accept values for Pid. Pname,Psellingprice and invokes SetRemarks() method.
A method Setdetails () that displays all the data members.
Answer:class PRODUCT:def init (self):self. Pid = self. Pname = self. Peostprice = 0.0 self. Psellingprice = 0.0 self. Margin = 0.0 self. Remarks = def SetRemarks (self) :self . Margin = self.Psellinrprice-self. Peostpriceif (self.Margin < 0) :self. Ramarks = “Loss”else:self. Remarks = “Profit” defGetdetails (self):self.Pid = rawjnput (“Enter Product Id”)self.Pname = rawjnput (“Enter Product Name”)self.Peostprice = input (“Enter Cost Price”)self.Psellingprice = input (“Enter Selling Price”)self. SetRemarks ( ) def Setdateils (self) :print “Product Id” ,self.Pid print “Product Name”,self.Pname print “Cost Price”,self.Pcostprice print “Selling Price”,self.Esellingprice print “Margin : ” ,self.Margin print “Incurred :” ,self.Remarks
Question 5:Write a Python program using classes and objects to simulate result preparation system for 20 students. The data available for each student includes: Name, Rollno, and Marks in 3 subjects. The percentage marks and grade are to be calculated from the following information:Also demonstrate constructor overloading.Answer:# constructor to create an objectdef init (self,s=None):#non-copy constructor if s==None:self.rollno = 0 self.name = ‘ ’self.marks = [0,0,0]self.avg = 0.0 self.grade = ‘ ’# copy constructor else:self.rollno = s.rollno self.name = s.name self.marks = s.marks self.avg = s.avgself.grade = s.gradedef read (self):# This function gets the details of a student from the userselfrollno=iaw_input(“Enter roll number.-’)self.name = raw_input(“Enter name:-”) s=0for i in range(0,3):self.marks [i] = int(r a w_input (“Enter the marks ?”)) s = s + self.marksfi] self.avg = s/3if(self.avg>60):self.grade=‘A’elif self.avg>40:self.grade=‘B’else:self.grade=‘C’def display (self):# This function prints each student’s detailsprint self.rollno,“\t”, self, name, “\t\ t”,self.grade s = StudentO studlist = []num = int(raw_input(“Enter no. of students:-’’))for i in range(O.num):s.read()studlist. append(Student(s))print “ STUDENT REPORT \n”print “***********************************\n”print “RollNo \t Name \t\t Grade”print “*******************************************\n”for i in range(0,num):studlist[i] .displayO#Initialize avg as the first student’s avg maxavg = studlist[0].avg totavg = 0for i in range(l.num):totavg = totavg + studlist[i].avg if studlist[i].avg > maxavg: maxavg = studlist[i].avg topper = studlist[i].name totavg = totavg/numprint “Class topper is”,studlist[i],name,“with average”, studlist [i]. avgprint “Class average is”,totavgclass Student:
Question 6:Define a class SUPPLY in Python with the following description:Private Members Code of type int FoodName of type string FoodType of type string Sticker of type stringA member function GetType() to assign the following values for Food Type as per the given Sticker
A function Foodln() to allow user to enter values for Code, EoodName, Sticker and call function GetType() to assign respective FoodType.
A function FoodOut() to allow user to view the contents of all the data members.
Answer:class SUPPLY:• constructor to create an objectdef init (self) :#constructorself.FoodCode=()self.FoodName=‘ ’self.FoodType=‘ ’self.Sticker=‘ ’def Foodln(self):self.FoodCode=input(“Enter Food Code”)self.FoodName=raw_input(“Enter Food Name”)self.Sticker=raw_input(“Enter Sticker Colour”)def GetType(self):if self.Sticker==‘GREEN’:self.FoodType = ‘Vegetarian’elif self.Sticker==’YELLOW’:self.FoodType = ‘Contains Egg’elif self.Sticker==‘RED’:self.FoodType = ‘Non-Vegetarian’ else:self.FoodType = ‘Not Known’def FoodOut(self):print “FoodCode’’,self.FoodCodeprint “FoodName”,self.FoodNameprint “FoodType”,self.FoodTypeprint “Sticker”,self.StickerS = SUPPLY()S.FoodIn()S.GetTÿpe()S.FoodOut()
TOPIC-3InheritanceVery Short Answer Type Questions (1 mark)
Question 1:Give one example for an abstract method.Answer:An abstract method is a method declared in a parent class, but not implemented in it. The implementation of such a method can be given in the derived class, class circle(object):def getradius(self):
Question 2:Define the term inheritance.Answer:Inheritance is a mechanism in which a new class is derived from an already defined class. The derived class is known as a subclass or a child class. The pre-existing class is known as base class or a parent class or a super class. The mechanism of inheritance gives rise to hierarchy in classes. The major purpose of inheriting a base class into one or more derived class is code reuse. The subclass inherits all the methods and properties of the super class.
Question 3:What is single inheritance?Answer:In single inheritance a subclass is derived from a single base class.
Question 4:What is multiple inheritance? Explain with an example.Answer:In this type of inheritance, the derived class inherits from one or more base classes. In the figure below, X and Y are the base classes while Z is the derived class.
Question 5:Give one example of multilevel inheritance.Answer:In multilevel inheritance, the derived class becomes the base of another class.For example, Country is the base class of State and City is the derived class of State.
Short Answer Type Questions (2 marks)
Question 1:Based on the diagram, answer the following:
Write the name of the base class and the derived classes.
Write the type of inheritance depicted in the above diagram.
Answer:
Base class – Furniture; Derived classes – Sofa & Cot
Hierarchical inheritance
Question 2:Explain the concept of overriding methods.Answer:Overriding is a very important part of OOB since it is the feature that makes inheritance exploit its full power. Through method overriding, a class may “copy” another class, avoiding duplicated code, and at the same time enhance or customize part of it.
Question 3:Based on the diagram, answer the following:
Write the name of the base class and derived class of state.
Write the type of inheritance depicted in the diagram.
Answer:
Base class of state – CountryDerived class of state – City
Multilevel inheritance
Question 4:What are the different ways of overriding function call in derived class of python? Illustrate with example.Answer:Overriding enables the programmer to provide specific implementation to a method in the derived class. So, the method invoked depends on the object used to invoke it. If base class object is used then base class version of the method is called else the derived class method is called, class Parent:def func(self):print ‘Parent method’ class child:def func(self):print ‘child method’C = child()c.func() # child calls overridden method
Question 5:How do we implement abstract method in Python?Support your answer with an example.Answer:An abstract method is a method defined in a base class, but that may not provide any implementation. It is done by using the abc module in Python, import abcclass Shape(object):metaclass = [email protected] method_to_implement(self, input):“’’’’Method documentationreturn
Question 6:Find the output of the following code and write the type of inheritance:p=Gstudent(‘Mona’, 20,12, $9, ‘computer’)def_init_(self, name, age, roll no, marks, stream):super (Gstudent, self) _init_(name, age, roll no, marks)self stream=streamdef display 2 (self):self display()print “stream:”,self.stream P=Gstudent (‘Mona’, 20,12, 99, ‘Computer’)p.display2()Answer:TVpe of inheritance: Multilevel Output:Name : MonaAge : 20Roll No: 12Marks : 99stream: computer
Question 7:Rewrite the following code after removing errors. Underline each correction and write the output after correcting the code:class First():def _init_ (self):print “first”:class Second(object):def _init_ (self):print “second” class Third(First, Second):def _init_ (self):First. _init_ (self):Second. _init_ (self):print “that’s it”t=Third()t=Third()Answer:class First():def _init_ (self):print “first”class Second(object):def_ init_(self):print “second” class Third(First, Second):def _init_ (self):First._init_ (self)Second._init_(self)print “that’s it”t=Third()t=Third()
Question 8:Complete the following code:class employee(object):def _init_(self,no,name,age):self.no=noself.name=___ #complete the statementself.age= ___ #complete the statementdef printval(self):print “Number:”,self.no print “Name :”,self.name print “Age :”,self.age class pay(object):def _init_ (self,dept,salary): #completethe definition__________________def display(self): #complete the definition______ # call printval()______ # print dept______ # print salaryAnswer:class employee (object):def init (self,no,name,age):self.no=noself.name=nameself.age=agedef printval(self):print “Number:”,self.no print “Name :”,self.nameprint “Age :’’,self.ageclass pay(object):def _init_ (self,dept,salary):self.dept =deptself.salary=salarydef display(self)self.printval()print self.deptprint self.salary
Long Answer Type Questions (4 marks)
Question 1:Write a Python program to demonstrate multiple inheritance. Consider 3 classes with the following description.Student class has 3 protected data members roll number, markl and mark2 of type integer. It has a get() function to get these details from the user. Sports class has a protected data member sports marks of type integer and a function getsm() to get the sports mark.Statement class uses the marks from Student class and the sports marks from the Sports class to calculate the total and average and displays the final resultAnswer:class student(object):# constructor to create an object def init (self):self.mo=0self.m1=0self.m2=0def get(self):self.mo=int(raw_input(“Enter the Roll no:”))print “Enter 2 marks”self.m1=int(raw_input(“Markl?”))self.m2=int(raw_input(“Mark2 ?”))classsports(object):# Sports markdef_init_(self):self.sm=0def getsm(self):self.sm=int(raw_input(“Enter the sports mark:”))class statement(student,sports):def_init_(self):super(statement,self)._init_()def display (self):tot=(self.ml+self.m2+self.sm); avg=tot/3;print“\n\n\tRoll No. : ”,self.mo,“\n\tTotal :”,tot print“\tAverage : ”,avgobj=statement()obj.get()obj.getsm()obj. display()
Question 2:SKP Hotel offers accommodation, meals facilities.Create a class Accommodation with Room Number, type of room, and rent, etc..Create a class meals services includes: meals code, name, price, etc..Create a class customer with customer number, name, address, etc.Customer class is derived by using Accommodation and meals classes.Answer:class Accommodation(object):# constructor to create an objectdef_init_(self):self.roomno=0self.roomtype=”self.roomrent=0.0defgetroom(self):self.roomno=input(“Enter the Room no:”)self.roomtype=rawjnput(“Enter the Room type:’)self.roomrent=float(raw_input(“Enter Room Rent”))class Meals(object):# Meals classdef_init_(self):self.mealcode=0self.mealname=“”self.mealprice=0.0def getmeals(self):self.mealcode=input(“Enter the meal code:”)self.mealname=raw_input(“Enter the meal name:”)self.mealprice=float(raw_input(“Enter the meal price”))class Customer(Accommodation,Meals):def_init_(self):super(Customer,self)._init_()self.custnum=0self.custname=‘ ’self.address=‘ ’def getCustomer(self):self.custnum=input(“Enter the customer number”)self.custname=raw_input(“Enter customer name”)self. address=raw _input(“Enter customer address”)def displaybill(self):print“Customer Name:”,self.custname,“Address:”, self, addressprint“Room No:”,self.roomno,“Room Type:”,self.roomtype,“Room Rent: Rs’jself.roomrentprint“Meal Name:”,self.mealname,“Price:”,self.mealpriceprint“Total Amount Due:”,self.roomrent+ self.mealpriceobj=Customer()obj.getCustomer()obj.getroom()obj.getmeals()obj.displaybill()
Question 3:Pay roll information system:Declare the base class ’employee’ with employee’s number, name, designation, address, phone number. Define and declare the function getdata() and putdata() to get the employee’s details and print employee’s details. Declare the derived class salary with basic pay, DA, HRA, Gross pay, PF, Income tax and Net pay. Declare and define the function getdatal() to call getdata() and get the basic pay. Define the function calculate() to find the net pay. Define the function display() to call putdata() and display salary details .Create the derived class object. Read the number of employees. Call the function getdatal)) and calculate() to each employees. Call the display() function.Answer:class employee (object):# constructor to create an objectdef init (self):self.eno=0self.name=‘ ’self.designation=‘ ’self.address = ‘ ’self.phonenumber=0def getdata(self):self.eno=input(“Enter Employee Number”)self.name=raw_input(“Enter Employee Name’)self.designation=raw_input(“Enter Employee Designation”)self.address = raw_input(“Enter Employee Address”)self.phonenumber=input(“Enter Employee Phone Number”)def putdata (self):print “Employee Number”,self.enoprint “Employee Name”,self.nameprint “Employee Designation”,self.designationprint “Employee Address”,self.addressprint “Employee Phone Number”,self phonenumberclass salary (employee):# Salary detailsdef_init_(self):super(salaryself)._init_()self.basic=0self.DA=0self.HRA=0self.Gross=0self.PF=0self.tax=0self.netpay=0def getdatal(self): self.getdata()self.basic=float(raw_input(“Enter the basic pay’’))self.DA=float(raw_input(“Enter the DA”))self.HRA=float(raw_input(“Enter the HRA))self.PF = float(raw_input(“Enter the PF”))def calculate(self):self.Gross= self.basic + self.FîRA + self.DAif .self. Gross < 100000:self.tax=0elif self.Gross < 500000:self.tax=self.Gross*0.10elif self.Gross < 1000000:self.tax=self.Gross*0.15else:self.tax=self.Gross*0.20self.netpay= self.Gross – self.PF – self.taxdef display(self):self.putdataOprint “Gross Income”,self.Grossprint “Tax “,self.taxprint “Net Income”,self.netpaysalaryobj =salary()num = int(raw_input(“Enter no. of employees:-”))for i in range(0,num):salaryobj.getdatal()salaryobj.calculate()salaryobj.display()
Question 4:Define a class employee in Python with the given specifications:Instance variables:Employee number, name Methods:Getdata()- To input employee number and namePrintdata()- To display employee number and nameDefine another class payroll, which is derived from employeeInstance variable Methods:Inputdata() – To call Getdata() and input salary.Outdata() – To call Printdata() and to display salary.Define another class leave, which is derived from payroll.Instance variable No of days Methods:acceptdata() – To call Inputdata() and input no of days.showdata() – To call Outdata() and to display no of days.Implement the above program in python.Answer:class Employee(object):# constructor to create an objectdef_init_(self):self.eno=0self.name=“”def Getdata(self):self.eno=input(“Enter the Employee no:”)self.name= raw_input(“Enter the Employee Name:”)def Printdata(self):print “Employee Number”,self.eno print “Employee Name”,self.nameclass payroll(Employee):def_init_(self):super(payroll,self). _init_()self.salary=0def Inputdata(self): self.GetdataQself.salary=float(raw_input(“Enter the salary:”))def Outdata(self): self.Printdata()print “Salary is”,self.salaryclass leave(payroll):def_init_(self):super(leave,self)._init_()self.Noofdays=0 def acceptdata(self):self.Inputdata()self.Noofdays =input(“Enter leave days”)def showdata(self): self.Outdata()print “No. of leave days”,self.Noofdays leaveobj = leave()leaveobj. acceptdataOleaveobj.showdata()
Question 5: What output will be generated when the following Python code is executed?def changeList () :L = []LI = [ ]L2 = []for i in range (10,1, -2) :LI append (i)for i in range (len ( LI)) :L2. append (LI [i] + L [i] )print L2ChangeList ( )Answer:[11, 10,9, 8, 7,4]
via Blogger https://ift.tt/3hs8vzC
0 notes
margdarsanme · 4 years
Text
NCERT Class 12 Computer Science Chapter 2 Object Oriented Programming Concepts
NCERT Class 12 Computer Science Python Solutions for Chapter 2 :: Object Oriented Programming Concepts
 TOPIC-1
General OOP ConceptsShort Answer Type Questions (2 marks)
Question 1:How is a static method different from an instance method?Answer:Static method has to be defined outside a class. It can be called without an object.Instance method is defined within a class and has to be invoked on an object.
Question 2:Explain Data Hiding with respect to OOP.Answer:Data hiding can be defined as the mechanism of hiding the data of a class from the outside world or to be precise, from other classes. Data hiding is achieved by making the members of the class private. Access to private members is restricted and is only available to the member functions of the same class. However the public part of the object is accessible outside the class.
Question 3:Fill in the blanks:
Act of representing essential features without background detail is called ______ .
Wrapping up of data and associated functions into a single unit is called ______ .
______ is called the instance of a class.
Answer:
Data Abstraction
Encapsulation
Object
Question 4:What is Object Oriented Programming? List some of its advantages.Answer:OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. Advantages:
Simplicity
Modifiability
Extensibility and Maintainability
Reusability
Security
Question 5:Differentiate between an object and a class.Answer:A class is a collection of objects of similar type.For example, mango, apple and orange are members of the class fruit. Classes are user-defined data types and behave like the built-in types of a programming language.The syntax used to create an object is not different than the syntax used to create an integer object in C. If fruit has been defined as a class, then the statement fruit mango; will create an object mango belonging to the class fruit.
Question 6:Explain polymorphism with an example.Answer:Polymorphism is the ability for a message or data to be processed in more than one form. An operation may exhibit different behaviors in different instances. For example, consider the operation of addition of two numbers, the operation will generate a sum. If the operands are strings, then the operation would produce a third string by concatenation.
Question 7:List three features that make an important charac-teristic of OOP.Answer:
Capability to express closeness with the real- world models.
Reusability-allows addition of new features to an existing one.
Transitivity-changes in one class get automatically reflected across.
Question 8:How do we implement abstract method in python? Give an example for the same.Answer:Abstract method : An unimplement method is called an abstract method. When an abstract medhod is declared in a base class the derived class has to define the method or raise “Notimplemented Error”
Or
Abstract Method can be used to enable parent class method execution.Class Shape (object):def findArea (self): passClass Square (Shape):def init (self, side):self, side = side def findArea self.side*self.side
Question 9:List few disadvantages of OOP.Answer:
Classes tend to be overly generalized.
Relationship among classes might become artificial.
Program design is tricky and complicated.
More skills and thinking in terms of objects is required.
Question 10:Explain Function overloading with an example.Answer:When several function declarations are specified for a single function name in the same scope, the function is said to be overloaded. In other languages, the same function name can be used to define multiple functions with different number and type of arguments, def test(): #function 1 print “hello”def test(a, b): #function 2return a+bdef test(a, b, c): #function 3return a+b+c 2
Question 11:What is inheritance? Explain with an example.Answer:Inheritance is the capability of one class to acquire the properties or capabilities of another class. For example, the bird ‘Parrot’ is a part of the class ‘Flying Bird’ which is again a part of the class ‘Bird’.
Question 12:How data encapsulation and data abstraction are implemented in Python, explain with an example.
Or
How do abstraction and encapsulation complement each other?Answer:Abstraction and Encapsulation are complementary concepts. Through encapsulation only we are able to enclose the components of the object into a single unit and separate the private and public members. It is through abstraction that only the essential behaviors of the objects are made visible to the outside world.So, we can say that encapsulation is the way to implement data abstraction. For example in class Student, only the essential information like roll no, name, date_of_birth, course, etc. of the student will be visible. The secret information like calculation of grades, allotment of examiners etc. will be hidden.
Question 13:Consider the figure given below and answer the questions that follows:
Name the base class and the derived class.
Which concept of OOP is implemented in the figure given above?
Answer:
Base class – STUDENTDerived classes – GRADUATE & POST GRADUATE
Inheritance
Question 14:What is abstract method? Give a suitable example to illustrate the same.Answer:Abstract Method: An abstract method is a method defined in the base class, but does not require code for the implementaion. e.g.,Class teacher: def entry (self):teach#=int(input(“Enter No”))def display ( ):print (self, teach #)
Question 15:What is the concept of overriding method? Give an example for the same.Answer:Overriding Methods : It is a method to access, the paramterized constructer with same name but having different parameters. For example,Class emp:def_init_(self, n):self, a = n def_init_(self):self, a = 100
Question 16:Is function overloading supported by Python? Give reasons.Answer:A given name can only be associated with one function at a time, so cannot overload a function with multiple definitions. If you define two or more functions with the same name, the last one defined is used.However, it is possible to overload a function, or otherwise genericized it. You simply need to create a dispatcher function that then dispatches to your set of corresponding functions. Another way to genericized a function is to make use of the simple generic module which lets you define simple single-dispatch generic functions.def test(): #function 1print “hello”def test(a, b): #function 2return a+bdef test(a, b, c): #function 3return a+b+cIf you run the code of three test functions, the second test() definition will overwrite the first one. Subsequently the third test() definition will overwrite the second one. That means if you give the function call test (20,20), it will flash an error stating, “Type Error: add() takes exactly 3 arguments (2 given)”. This is because, Python understands the latest definition of the function test() which takes three arguments.
Question 17:Predict the output of the following program. Also state which concept of OOP is being implemented?def sum(x,y,z):print “sum= ”, x+y+zdef sum(a,b):print “sum= ”, a+bsum(10,20)sum(10,20,30)Answer:Type Error: sum() takes exactly 3 arguments (2 given)Concept: Polymorphism [Function Overloading]
Question 18:Define binding. Differentiate between static and dynamic binding.Answer:Binding is the process of linking the function call to the function definition. The body of the function is executed when the function call is made. Binding can be of two types:Static Binding: In this type of binding, the linking of function call to the function definition is done during compilation of the program.Dynamic Binding: In this type of binding, linking of a function call to the function definition is done at run time. That means the code of the function that is to be linked with function call is unknown until it is executed.
Long Answer Type Questions (4 marks)
Question 1:Write a program that uses an area() function for the calculation of area of a triangle or a rectangle or a square. Number of sides (3, 2 or 1) suggest the shape for which the area is to be calculated.Answer:from functools import wrapsimport mathdef overloaded(func):@wraps(func)def overloaded_func(*args, **kwargs):for f in overloaded_func.overloads:try:return f(*args, **kwargs)except TÿpeError:passelse:# it will be nice if the error message prints a list of# possible signatures hereraise TÿpeError(“No compatible signatures”)def overload_with(func):overloaded_func.overloads.append(func)return overloaded_funcoverloadedjunc.overloads = [func]overloaded_func.overload_with = overload_withreturn overloaded_func
#############©overloadeddef area():print ‘Area’[email protected]_withdef _(a):# note that, like property(), the function’s name in# the “def _(n):” line can be arbitrary, the important# name is in the “@overloads(a)” lineprint ‘Area of square=’,a*apass
@area.overload_withdef _(a,b):# note that, like property(), the function’s name in# the “def _(nl,n2):” line can be arbitrary, the important t# name is in the “@overloads(a)” lineprint Area of rectangle=’,a*[email protected]_withdef _(a.b,c):s= (a+b+c)/2print sprint Area of triangle=’, math.sqrt(s*(s-a)* (s-b)*(s-c))passchoice=input(“Enter 1-square 2-rectangle 3- tr-iangle”)if choice==1:side = input(“Enter side”) area(side)elif choice ==2:length = input(“Enter length”)breadth = input(“Enter breadth”)area(length,breadth) elif choice==3:a = inputfEnter sidel”)b = inputfEnter side2”)c = inputfEnter side3”) area(a,b,c)else:print “Invalid choice”
Question 2:Write a program to find out volume of a cube, cuboid and cylinder using function overloading.Answer:from functools import wraps import math def overloaded(func):@wraps(func)def overloaded_funcfargs, **kwargs):for f in overloaded_func.overloads:try:return ff args, **kwargs)except TypeError:pass 1else:# it will be nice if the error message prints a list of# possible signatures here raiseTypeError(“No compatible signatures”)def overload_with(func):overloaded_func.overloads.append(func)return overloaded_funcoverloaded_func.overloads = [func]overloaded_func.overload_with = overload_withreturn overloaded_func #############@overloadeddef volume():print ‘Volume’[email protected]_with def _(a):print ‘Volume of cube=’,a*a*a, ‘cubic units’[email protected]_with def _(a,b):print ‘Volume of cylinder, 3.14*a*a*b,‘cubic units’[email protected]_with def _(a,b,c):print ‘Volume of cuboid=’, a*b*c, ‘cubic units’passchoice = input(“Enter 1-cube 2-cylinder 3-cuboid”)if choice==1:side = input(“Enter side”)volume (side)elif choice ==2:radius = input(“Enter radius”)height = input( “Enter height”)volume(radius,height)elif choice==3:length = input(“Enter length”)breadth = input(“Enter breadth”)height = input(“Enter height”)volume (length, breadth, height)else:print “Invalid choice”
Question 3:Write a class CITY in Python with following specification :
Code  # Numberic value
Name  # String value
Pop  # Numberic value for Population
KM  # Numberic value
Density  # Numberic value for Population DensityMethods:
CalDen ( ) # Method to calculate Density as Pop /KM
Record ( ) # Method to allow user to enter values Code, Name, Pop, KM and call CalDen ( ) method
See ( ) # Method to display all the date members also display a message “Highly Populated Area” is the Density is more than 12000.
Answer:class CITY:def _init_ (self):self. Code = 0self. Name =” ”self. Pop = 0self. KM = 0self. Density = 0def CalDen (self):self. Density = self. Pop/self. KMdef Record (self)self: Code = input (“Enter Code”)self.Name=raw_input(“Enter Name”)self. Pop = input (“Enter population”)self. KM = input (“Enter KM”)CalDen (self) // or self.CalDen ( )def See (self):print Code, name, Pop, KM, Densityif self. Density > 12000:print (“Highly Populated Area”)# OR print (“Highly populated Area”)Note : Accept self. _Cose to indicate private members
Question 4:Give a suitable example using Python code to illustrate single level inheritance considering COUNTRY to be BASE class and STATE to be derived class.Answer:Class COUNTRY: statejist = [ ]def_init_(self, name):self.name = name class state (COUNTRY):def_init_(self, name, capital): super ( )._init_(name)self.capital = capital
Question 5:Write a class DISTRICT in Python with following specification:Instance Attributes– Dcode # Numeric value– DName # String value– People # Numeric value for Population– Area # Numeric value– Density # Numeric value for Population DensityAnswer:Class DISTRICT ( ) :def_init_(self, Dcode, DName, People, Area, Density):self.Dcode = Dcodeself.DName = DNameself.People = Peopleself. Area = Areaself.Density = DensityDef display (self):print (“District Code”, self.Dcode)printf (“District Name”, self.Dname)printf (“Population”, self.people)printf (“Area”, self.Area)printf (“Density”, self.Denstity)
Question 6:Answer the question (i) to (iv) based on the following:Class Shop (object):Class shop_(self) :self . no_of _employees = 0self. no_of _brands= 0def getSdate (self) :self. no_of_employees=input(“Number of employees”)self.no_of_brands=input(”Number of brands”)def showSdate (self) :Print self.no of employeesPrint self.no of brands class Brand (object) :def init_(self) :self.name = ” ”self.category=(“Mens”, “Womens”, “Kids”)self.avgprice=0, 0def getdate (self) :self.name = raw_input(“Enter Brand Name”)self.avgprice = input(”Enter Average Price”)def showdate (self) :Print self, namePrint self, categoryPrint self, avgpriceClass Mall (Brand, Shop) :def showdate (self) :self.no of shops = 0def getdate (self) :super (mall, self).getSdate ( ) # Statementsuper (mall, self).getdate ( ) # Statement 2self.no_of_shops=input (“Enter number of shops”)def showdata(self)print self.no_of_shopsprint self.no of brands # Blank 1
Which type of inheritance is demonstrated in the above code?
Explain Statement 1 and 2.
Name the methods that are overridden along with their class name.
Fill Blank 1 with a statement to display variable category of class Brand.
Answer:
Multiple Inheritance
Statement 1 and 2 invoke the getSdate() function of class shop and getData() function of class Brand respectively.
getdata() method of class Brand is overridden. When object of class Mall is created.M=Mall ( )k.getdata ( )getdate( ) methodof class Mall is invoked and not of class Brand is called.
print Brand ( ). category
TOPIC-2ClassesShort Answer Type Questions (2 marks)
Question 1:Give one word for the following:a. A sort of constructor in Python ______b. A region of a Python program where a namespace is directly accessible.______c. It returns the docstring of a class.______d. It returns the string representation of the object. ______e. A method used to delete an attribute. ______Answer:a. _init_b. scopec. _doc_d. _str_e. _delattr_ ()
Question 2:Define a namespace. Give examples of namespaces with respect to Python.Answer:Namespace is a mapping from names to objects. Examples of namespaces are built-in names, global names in a module and local names in function invocation.
Question 3:What is the significance of super method? Give on example of the same.Answer:super ( ) function is used to call base class methods which has been extended in derived class.Example :class GradStudent (Student):def_ init _(self) :super (GradStudent, self). _init _( )self. subject = ” ”self. working = ” ”def readGrad (self) :# Call readStudent method of parent class super (GradStudent, self). readStudent ( )
Question 4:Explain LEGB rule.Answer:LEGB rule: when a name is encountered during the execution of the program , it searches for that name in the following order:L. Local – It first makes a local search, i.e. in current def statement.E. Enclosing functions – It searches in all enclosing functions, form inner to outer.G. Global (module) – It searches for global modules or for names declared globalB. Built-in (Python) – Finally it checks for any built in functions in Python.
Question 5:Is object of a class mutable? Why/why not?Answer:User classes are considered mutable. Python doesn’t have (absolutely) private attributes, so you can always change a class.
Question 6:Explain the usage of keyword ‘pass’ in class definition.Answer:When a class doesn’t define any methods or attributes, but syntactically, there needs to be something in the definition, so we use pass. It is a statement that does nothing, and is a good placeholder when you are stubbing out functions or classes.
Question 7:What is the use of _init_ ? When is it called? Explain with an example.Answer:
_init_ help to create objects and instances to the parent class.
It reserve the memory to the members of the class.
Question 8:Explain the importance of self in Python classes.Answer:self is an object reference to the object itself, therefore, they are same. Python methods are not called in the context of the object itself, self in Python may be used to deal with custom object models.
Question 9:Differentiate between class attributes and instance attributes.Answer:The difference is that the attribute on the class is shared by all instances. The attribute on an instance is unique to that instance.
Question 10:Explain _str_ with an example.Answer:_str_ , returns a string representation of a Point object. If a class provides a method named _str_ , it overrides the default behavior of the Python built-in _str_ function.>>> p = Point(3, 4)>>> str(p)‘(3,4)’Printing a Point object implicitly invokes _str_ on the object, so*- defining _str_ also changes the behavior of print:>>> p = Point(3,4)>>> print p(3,4)
Question 11:What do you mean by name mangling? Support your answer with relevant example.Answer:Name mangling of the double underscore makes the most sense for achieving “private-ness”. Now when a function is called from the ‘self’ instanceand it notices that it starts with ‘_’, it just performs the name mangling right there. Name mangling is helpful for letting sub-classes override methods without breaking intra class method calls.
Question 12:Differentiate between reference counting and automatic garbage collection with respect to Python.Answer:Reference counting works by counting the number of times an object is referenced by other objects in the system. Python’s garbage collector runs during program execution and is triggered when an object’s reference count reaches zero. An object’s reference count changes as the number of aliases that point to it change. An object’s reference count increases when it is assigned a new name or placed in a container (list, tuple or dictionary). The object’s reference count decreases when it is deleted with del, its reference is reassigned, or its reference goes out of scope. When an object’s reference count reaches zero, Python collects it automatically.Automatic garbage collectiomPython deletes the objects which are not required, may it be built-in types or class instances, through the process named garbage collection. When the number of allocations minus the number of de-allocations are greater than the threshold number, the garbage collector is run and the unused block of memory is reclaimed.One can inspect the threshold for new objects by loading the garbage collector (gc) module and asking for garbage collection thresholds.
Question 13:Predict the output of the following code snippet:ptr=40def result():print ptrptr=90def func(var):if var<=60:ptr=30print ptrresult()func(60)func(70)Answer:UnboundLocalError: local variable ‘ptr’ referenced before assignment.
Question 14:What is the difference between Multilevel inheritance and multiple inheritance? Give suitable examples to illustrate.Answer:
Question 15:How do you implement abstract method in Python? Give an example for the same.Answer:Abstract method : An unimplemented method is an abstract method. When an abstract method is declared in a base class, the drived class has to either difine the method or raise” Nothlmplemented Error”class Shape (object):def findArea (self):passclass Square (Shape):def_ init_(self, side):self, side = sidedef find Area (self):return self.side*self.sideNote: We can use @ abstract method to enable parent class method to be executed.
Question 16:Predict the output of the following code snippet:ptr=50def result():global ptrptr=ptr+1print ptr result()print ptrAnswer:5151
Question 17:Name the methods that can be used to:
access attribute of an object
delete an attribute of an object
Answer:
getattr(obj, name[, default])
delattr(obj, name)
Question 18:Give the statement to:
Check whether the attribute str exists in the class Test whose object is T
Assign a value “Hello” to the attribute str of class Test and object Tl.
Answer:
hasattr (Tl,str)
setattr (Tl, str, “Hello”)
Question 19:Predict the output of the following code:class Match:#“Runs and Wickets”runs=281wickets=5def init (self,runs, wickets) :self.runs=runsself.wickets=wicketsprint “Runs scored are :” ,runsprint “Wickets taken are :” .wicketsprint “Test. do :”, Match. docprint “Test._name_ , Match. _name_print “Test_module_ , Match.__module_print “Test. _bases_ , Match._bases_print “Test._dict_ , Match. _diet_Answer:Runs scored are : 281Wickets taken are : 5Test._ do_ : NoneTest._name_ : MatchTest._module_ : mainTest._bases_ : ()Test. _diet_ : {‘ _module _’: ‘_ main_ ’, ‘_doc _’: None, ‘runs’: 281, ‘_init_ ’:<function _init_ at 0x0000000002DDFBA8>, ‘wickets’: 5}
Long Answer Type Questions (4 marks)
Question 1:Write a class customer in Python Containing Deduct % Mark to be deducted if caldiscount () is following specifications. not invoked properly
Instance attributes: inside input( ) functioncustomernumber – numeric value No mark to be deducted if member functioncustomemame – string value definitions are written inside the class
price, qty discount, totalprice, netprice – numeric valuemethods : 
init()-To assign initial values of customernumber as 111, customemame as “Leena”, qty as 0 and price, discount & netprice as 0.
caldiscount ( ) – To calculate discount, totalprice and netpricetotalprice = price * qty
discount is 25% of totalprice, if totalprice >=50000
discount 15% of totalprice, if totalprice >=25000 and totalprice <50000
discount 10% of totalprice, if totalprice <250000netprice= totalprice – discount
input()-to read data members customer- name, customernumber, price, qty and call caldiscount() to calculate discount, totalprice and netprice.
show( ) – to display Customer details.
Answer:
class customer:def _init_(self):self.customemumber=111self.customemame=‘Leena’self.qty=0self.price=0self.discount=0self.netprice=0def caldiscount(self):totalprice = self.price*self.qtyif totalprice >= 50000:self.discount=totalprice * 0.25elif totalprice >= 25000:self.discount = totalprice * 0.15 else:self.discount = totalprice * 0.10self.netprice = totalprice – self.discountdef input(self):self.customernumber=input(“Enter Customer Number”)self.customemame = raw_input(“Enter Customer Name”)self.qty = input(“Enter Quantity”)self.price = input(“Enter Price”)self.caldiscount()def show(self):print “Customer Number”,self.customernumberprint “Customer Name”,self.customemameprint “Quantity”,self.quanti-typrint “Price”,self.priceprint “Discount”,self.discountprint “Net price”,self.netpricec = customer()c.inputO c.show()
Question 2:Create the class SOCIETY with following information:society_name,house_no,no_of_members,flat, incomeMethods :
An _init_ method to assign initial valuesof society_name as “Surya Apartments”, flat as “AType”, house_.no as 20, no_of_ members as 3, income as 25000.
Inputdata()-To read data members(society,house_no,no_of members & income) and call allocate_flat().
allocate_flat( )-To allocate flat according to income
ShowData() to display the details of the entire class.
Answer:class SOCIETY:# constructor to create an objectdef init (self):#constructorself. society_name=‘Surya Apartments’self.house_no=20self.no_of_members=3self.flat=AType’self.income=25000def Inputdata(self):self. society_name = raw_input (“Enter Society Name”)self.house_no=input(“Enter House Number”)self.no_of_members = input (“Enter No. of members”)self.income = float(raw_input (“Enter income”))def Allocate_Flat(self):if self.income >= 25000:self.flat = AType’elif self.income >= 20000 and self.income < 25000 :self.flat = ‘BTÿpe’ else:self.flat = ‘CType’def Showdata(self):print “Society Name”,self.society_nameprint “House_No”,self.house_no print “No.of members”,self.no_of mem-bersprint “Flat Type”,self.flat print “Income”,self.incomeS = SOCIETY))S.InputdataOS.Allocate_Flat()S.ShowdataO
Question 3:Define a class ITEMINFO in Python with the following description:ICode (Item Code), Item (Item Name), Price (Price of each item), Qty (quantity in stock)Discount (Discount percentage on the item), Netprice (Final Price)Methods
A member function FindDisc( ) to calculate discount as per the following rules:If Qty< = 10Discount is 0If Qty (11 to 20)Discount is 15If Qty > =20Discount is 20
A constructor init method) to assign the value with 0 for ICode, Price, Qty, Netprice and Discountand null for Item respectively
A function Buy( ) to allow user to enter values for ICode, Item, Price, Qty and call function FindDisc( )to calculate the discount and N etprice(Price * Qty-Discount).
A Function ShowAll( ) to allow user to view the content of all the data members.
Answer:class ITEMINFO:#constructor to create an .objectdef_init_(self):#constructorself.ICode=0self.Item=‘ ’self.Price=0.0self.Qty=‘ ’self.Discount=0self.Netprice=0.0def Buy(self):self.ICode=input(“Enter Item Code”)self. Item=raw_input(“Enter Item Name”)self.Price=float(raw_input(“Enter Price”))self.Qty=input(“Enter Quantity”)def FindDisc(self):if self.Qty <= 10:self.Discount = 0elif self.Qty >= 11 and self.Qty < 20 :self.Discount = 15else:self.Discount = 20self.Netprice= (self.Price*self.Qty)self.Discountdef ShowAll(self):print “Item Code’’,self.ICodeprint “Item Name”,self.Itemprint “Price”,self.Priceprint “Quantity”,self.Qtyprint “NetPrice”,self.NetpriceI = ITEMINFO()I.Buy()I.FindDisc()I. Show All ()
Question 4:Define a class PRODUCT in Python with the following specifications :Data members:Pid – A string to store product.Pname -A string to store tha name of the product. Peostprice – A decimal to store the cost price of the productPsellingprice – A decimal to store Selling Price Margin- A decimal to be calculated as Psellingprice- PcostpriceRemarks- To store “Profit” if Margin is positive else “Loss’ if Margin is negativeMember Functions :
A constructor to intialize All the data members with valid default values.
A method SetRemarks() that assigns Margin as Psellingprice – Peostprice and sets Remarks as mentioned below :
A method Getdetails() to accept values for Pid. Pname,Psellingprice and invokes SetRemarks() method.
A method Setdetails () that displays all the data members.
Answer:class PRODUCT:def init (self):self. Pid = self. Pname = self. Peostprice = 0.0 self. Psellingprice = 0.0 self. Margin = 0.0 self. Remarks = def SetRemarks (self) :self . Margin = self.Psellinrprice-self. Peostpriceif (self.Margin < 0) :self. Ramarks = “Loss”else:self. Remarks = “Profit” defGetdetails (self):self.Pid = rawjnput (“Enter Product Id”)self.Pname = rawjnput (“Enter Product Name”)self.Peostprice = input (“Enter Cost Price”)self.Psellingprice = input (“Enter Selling Price”)self. SetRemarks ( ) def Setdateils (self) :print “Product Id” ,self.Pid print “Product Name”,self.Pname print “Cost Price”,self.Pcostprice print “Selling Price”,self.Esellingprice print “Margin : ” ,self.Margin print “Incurred :” ,self.Remarks
Question 5:Write a Python program using classes and objects to simulate result preparation system for 20 students. The data available for each student includes: Name, Rollno, and Marks in 3 subjects. The percentage marks and grade are to be calculated from the following information:Also demonstrate constructor overloading.Answer:# constructor to create an objectdef init (self,s=None):#non-copy constructor if s==None:self.rollno = 0 self.name = ‘ ’self.marks = [0,0,0]self.avg = 0.0 self.grade = ‘ ’# copy constructor else:self.rollno = s.rollno self.name = s.name self.marks = s.marks self.avg = s.avgself.grade = s.gradedef read (self):# This function gets the details of a student from the userselfrollno=iaw_input(“Enter roll number.-’)self.name = raw_input(“Enter name:-”) s=0for i in range(0,3):self.marks [i] = int(r a w_input (“Enter the marks ?”)) s = s + self.marksfi] self.avg = s/3if(self.avg>60):self.grade=‘A’elif self.avg>40:self.grade=‘B’else:self.grade=‘C’def display (self):# This function prints each student’s detailsprint self.rollno,“\t”, self, name, “\t\ t”,self.grade s = StudentO studlist = []num = int(raw_input(“Enter no. of students:-’’))for i in range(O.num):s.read()studlist. append(Student(s))print “ STUDENT REPORT \n”print “***********************************\n”print “RollNo \t Name \t\t Grade”print “*******************************************\n”for i in range(0,num):studlist[i] .displayO#Initialize avg as the first student’s avg maxavg = studlist[0].avg totavg = 0for i in range(l.num):totavg = totavg + studlist[i].avg if studlist[i].avg > maxavg: maxavg = studlist[i].avg topper = studlist[i].name totavg = totavg/numprint “Class topper is”,studlist[i],name,“with average”, studlist [i]. avgprint “Class average is”,totavgclass Student:
Question 6:Define a class SUPPLY in Python with the following description:Private Members Code of type int FoodName of type string FoodType of type string Sticker of type stringA member function GetType() to assign the following values for Food Type as per the given Sticker
A function Foodln() to allow user to enter values for Code, EoodName, Sticker and call function GetType() to assign respective FoodType.
A function FoodOut() to allow user to view the contents of all the data members.
Answer:class SUPPLY:• constructor to create an objectdef init (self) :#constructorself.FoodCode=()self.FoodName=‘ ’self.FoodType=‘ ’self.Sticker=‘ ’def Foodln(self):self.FoodCode=input(“Enter Food Code”)self.FoodName=raw_input(“Enter Food Name”)self.Sticker=raw_input(“Enter Sticker Colour”)def GetType(self):if self.Sticker==‘GREEN’:self.FoodType = ‘Vegetarian’elif self.Sticker==’YELLOW’:self.FoodType = ‘Contains Egg’elif self.Sticker==‘RED’:self.FoodType = ‘Non-Vegetarian’ else:self.FoodType = ‘Not Known’def FoodOut(self):print “FoodCode’’,self.FoodCodeprint “FoodName”,self.FoodNameprint “FoodType”,self.FoodTypeprint “Sticker”,self.StickerS = SUPPLY()S.FoodIn()S.GetTÿpe()S.FoodOut()
TOPIC-3InheritanceVery Short Answer Type Questions (1 mark)
Question 1:Give one example for an abstract method.Answer:An abstract method is a method declared in a parent class, but not implemented in it. The implementation of such a method can be given in the derived class, class circle(object):def getradius(self):
Question 2:Define the term inheritance.Answer:Inheritance is a mechanism in which a new class is derived from an already defined class. The derived class is known as a subclass or a child class. The pre-existing class is known as base class or a parent class or a super class. The mechanism of inheritance gives rise to hierarchy in classes. The major purpose of inheriting a base class into one or more derived class is code reuse. The subclass inherits all the methods and properties of the super class.
Question 3:What is single inheritance?Answer:In single inheritance a subclass is derived from a single base class.
Question 4:What is multiple inheritance? Explain with an example.Answer:In this type of inheritance, the derived class inherits from one or more base classes. In the figure below, X and Y are the base classes while Z is the derived class.
Question 5:Give one example of multilevel inheritance.Answer:In multilevel inheritance, the derived class becomes the base of another class.For example, Country is the base class of State and City is the derived class of State.
Short Answer Type Questions (2 marks)
Question 1:Based on the diagram, answer the following:
Write the name of the base class and the derived classes.
Write the type of inheritance depicted in the above diagram.
Answer:
Base class – Furniture; Derived classes – Sofa & Cot
Hierarchical inheritance
Question 2:Explain the concept of overriding methods.Answer:Overriding is a very important part of OOB since it is the feature that makes inheritance exploit its full power. Through method overriding, a class may “copy” another class, avoiding duplicated code, and at the same time enhance or customize part of it.
Question 3:Based on the diagram, answer the following:
Write the name of the base class and derived class of state.
Write the type of inheritance depicted in the diagram.
Answer:
Base class of state – CountryDerived class of state – City
Multilevel inheritance
Question 4:What are the different ways of overriding function call in derived class of python? Illustrate with example.Answer:Overriding enables the programmer to provide specific implementation to a method in the derived class. So, the method invoked depends on the object used to invoke it. If base class object is used then base class version of the method is called else the derived class method is called, class Parent:def func(self):print ‘Parent method’ class child:def func(self):print ‘child method’C = child()c.func() # child calls overridden method
Question 5:How do we implement abstract method in Python?Support your answer with an example.Answer:An abstract method is a method defined in a base class, but that may not provide any implementation. It is done by using the abc module in Python, import abcclass Shape(object):metaclass = [email protected] method_to_implement(self, input):“’’’’Method documentationreturn
Question 6:Find the output of the following code and write the type of inheritance:p=Gstudent(‘Mona’, 20,12, $9, ‘computer’)def_init_(self, name, age, roll no, marks, stream):super (Gstudent, self) _init_(name, age, roll no, marks)self stream=streamdef display 2 (self):self display()print “stream:”,self.stream P=Gstudent (‘Mona’, 20,12, 99, ‘Computer’)p.display2()Answer:TVpe of inheritance: Multilevel Output:Name : MonaAge : 20Roll No: 12Marks : 99stream: computer
Question 7:Rewrite the following code after removing errors. Underline each correction and write the output after correcting the code:class First():def _init_ (self):print “first”:class Second(object):def _init_ (self):print “second” class Third(First, Second):def _init_ (self):First. _init_ (self):Second. _init_ (self):print “that’s it”t=Third()t=Third()Answer:class First():def _init_ (self):print “first”class Second(object):def_ init_(self):print “second” class Third(First, Second):def _init_ (self):First._init_ (self)Second._init_(self)print “that’s it”t=Third()t=Third()
Question 8:Complete the following code:class employee(object):def _init_(self,no,name,age):self.no=noself.name=___ #complete the statementself.age= ___ #complete the statementdef printval(self):print “Number:”,self.no print “Name :”,self.name print “Age :”,self.age class pay(object):def _init_ (self,dept,salary): #completethe definition__________________def display(self): #complete the definition______ # call printval()______ # print dept______ # print salaryAnswer:class employee (object):def init (self,no,name,age):self.no=noself.name=nameself.age=agedef printval(self):print “Number:”,self.no print “Name :”,self.nameprint “Age :’’,self.ageclass pay(object):def _init_ (self,dept,salary):self.dept =deptself.salary=salarydef display(self)self.printval()print self.deptprint self.salary
Long Answer Type Questions (4 marks)
Question 1:Write a Python program to demonstrate multiple inheritance. Consider 3 classes with the following description.Student class has 3 protected data members roll number, markl and mark2 of type integer. It has a get() function to get these details from the user. Sports class has a protected data member sports marks of type integer and a function getsm() to get the sports mark.Statement class uses the marks from Student class and the sports marks from the Sports class to calculate the total and average and displays the final resultAnswer:class student(object):# constructor to create an object def init (self):self.mo=0self.m1=0self.m2=0def get(self):self.mo=int(raw_input(“Enter the Roll no:”))print “Enter 2 marks”self.m1=int(raw_input(“Markl?”))self.m2=int(raw_input(“Mark2 ?”))classsports(object):# Sports markdef_init_(self):self.sm=0def getsm(self):self.sm=int(raw_input(“Enter the sports mark:”))class statement(student,sports):def_init_(self):super(statement,self)._init_()def display (self):tot=(self.ml+self.m2+self.sm); avg=tot/3;print“\n\n\tRoll No. : ”,self.mo,“\n\tTotal :”,tot print“\tAverage : ”,avgobj=statement()obj.get()obj.getsm()obj. display()
Question 2:SKP Hotel offers accommodation, meals facilities.Create a class Accommodation with Room Number, type of room, and rent, etc..Create a class meals services includes: meals code, name, price, etc..Create a class customer with customer number, name, address, etc.Customer class is derived by using Accommodation and meals classes.Answer:class Accommodation(object):# constructor to create an objectdef_init_(self):self.roomno=0self.roomtype=”self.roomrent=0.0defgetroom(self):self.roomno=input(“Enter the Room no:”)self.roomtype=rawjnput(“Enter the Room type:’)self.roomrent=float(raw_input(“Enter Room Rent”))class Meals(object):# Meals classdef_init_(self):self.mealcode=0self.mealname=“”self.mealprice=0.0def getmeals(self):self.mealcode=input(“Enter the meal code:”)self.mealname=raw_input(“Enter the meal name:”)self.mealprice=float(raw_input(“Enter the meal price”))class Customer(Accommodation,Meals):def_init_(self):super(Customer,self)._init_()self.custnum=0self.custname=‘ ’self.address=‘ ’def getCustomer(self):self.custnum=input(“Enter the customer number”)self.custname=raw_input(“Enter customer name”)self. address=raw _input(“Enter customer address”)def displaybill(self):print“Customer Name:”,self.custname,“Address:”, self, addressprint“Room No:”,self.roomno,“Room Type:”,self.roomtype,“Room Rent: Rs’jself.roomrentprint“Meal Name:”,self.mealname,“Price:”,self.mealpriceprint“Total Amount Due:”,self.roomrent+ self.mealpriceobj=Customer()obj.getCustomer()obj.getroom()obj.getmeals()obj.displaybill()
Question 3:Pay roll information system:Declare the base class ’employee’ with employee’s number, name, designation, address, phone number. Define and declare the function getdata() and putdata() to get the employee’s details and print employee’s details. Declare the derived class salary with basic pay, DA, HRA, Gross pay, PF, Income tax and Net pay. Declare and define the function getdatal() to call getdata() and get the basic pay. Define the function calculate() to find the net pay. Define the function display() to call putdata() and display salary details .Create the derived class object. Read the number of employees. Call the function getdatal)) and calculate() to each employees. Call the display() function.Answer:class employee (object):# constructor to create an objectdef init (self):self.eno=0self.name=‘ ’self.designation=‘ ’self.address = ‘ ’self.phonenumber=0def getdata(self):self.eno=input(“Enter Employee Number”)self.name=raw_input(“Enter Employee Name’)self.designation=raw_input(“Enter Employee Designation”)self.address = raw_input(“Enter Employee Address”)self.phonenumber=input(“Enter Employee Phone Number”)def putdata (self):print “Employee Number”,self.enoprint “Employee Name”,self.nameprint “Employee Designation”,self.designationprint “Employee Address”,self.addressprint “Employee Phone Number”,self phonenumberclass salary (employee):# Salary detailsdef_init_(self):super(salaryself)._init_()self.basic=0self.DA=0self.HRA=0self.Gross=0self.PF=0self.tax=0self.netpay=0def getdatal(self): self.getdata()self.basic=float(raw_input(“Enter the basic pay’’))self.DA=float(raw_input(“Enter the DA”))self.HRA=float(raw_input(“Enter the HRA))self.PF = float(raw_input(“Enter the PF”))def calculate(self):self.Gross= self.basic + self.FîRA + self.DAif .self. Gross < 100000:self.tax=0elif self.Gross < 500000:self.tax=self.Gross*0.10elif self.Gross < 1000000:self.tax=self.Gross*0.15else:self.tax=self.Gross*0.20self.netpay= self.Gross – self.PF – self.taxdef display(self):self.putdataOprint “Gross Income”,self.Grossprint “Tax “,self.taxprint “Net Income”,self.netpaysalaryobj =salary()num = int(raw_input(“Enter no. of employees:-”))for i in range(0,num):salaryobj.getdatal()salaryobj.calculate()salaryobj.display()
Question 4:Define a class employee in Python with the given specifications:Instance variables:Employee number, name Methods:Getdata()- To input employee number and namePrintdata()- To display employee number and nameDefine another class payroll, which is derived from employeeInstance variable Methods:Inputdata() – To call Getdata() and input salary.Outdata() – To call Printdata() and to display salary.Define another class leave, which is derived from payroll.Instance variable No of days Methods:acceptdata() – To call Inputdata() and input no of days.showdata() – To call Outdata() and to display no of days.Implement the above program in python.Answer:class Employee(object):# constructor to create an objectdef_init_(self):self.eno=0self.name=“”def Getdata(self):self.eno=input(“Enter the Employee no:”)self.name= raw_input(“Enter the Employee Name:”)def Printdata(self):print “Employee Number”,self.eno print “Employee Name”,self.nameclass payroll(Employee):def_init_(self):super(payroll,self). _init_()self.salary=0def Inputdata(self): self.GetdataQself.salary=float(raw_input(“Enter the salary:”))def Outdata(self): self.Printdata()print “Salary is”,self.salaryclass leave(payroll):def_init_(self):super(leave,self)._init_()self.Noofdays=0 def acceptdata(self):self.Inputdata()self.Noofdays =input(“Enter leave days”)def showdata(self): self.Outdata()print “No. of leave days”,self.Noofdays leaveobj = leave()leaveobj. acceptdataOleaveobj.showdata()
Question 5: What output will be generated when the following Python code is executed?def changeList () :L = []LI = [ ]L2 = []for i in range (10,1, -2) :LI append (i)for i in range (len ( LI)) :L2. append (LI [i] + L [i] )print L2ChangeList ( )Answer:[11, 10,9, 8, 7,4]
from Blogger http://www.margdarsan.com/2020/09/ncert-class-12-computer-science-chapter_90.html
0 notes