\n\n\n\n

Welcome! user,keep scrolling down to see more! :D have a great day

\n\n\n \n\n\n\n\n\n\n\n \n \n My online portfolio\n \n \n \n
\n
\n

hey there :D\n
\n i am AnNmAy\n\n \n \n and this is some About me \n \n \n \n
\n
\n

hey!👋 welcome to my very own website!!!

\n

My name is Annmay :), and I am a
\n 12-year-old, turning 13 on july,. i am a 7th Grade student. On
\n this site, you'll find some information
about me, my hobbies, and the
things I'm passionate about!.
\n

\n

Thanks for visiting!

\n
\n
\n \n
\n \n
\n
\n

MY HOBBIES

\n
\n Here on my website, I want to share some of my favorite hobbies with you. I love my hobbies and enjoy spending my free time doing these activities.\n
\n
\n
\n
\n \n
\n
01. horse rideing
\n
\n
\n
\n \n
\n
02. edm
\n
\n
\n
\n \n
\n
03. Games
\n
\n
\n
\n
\n

\n MY SCHOOL\n \n

\n
\n alright, so in here you will know which school i go and whats my favrouite subject!!, first off i study in dpsk also knows as dps kalinga and i study in class 7\n
\n
\n
computer
\n
Maths
\n
SST
\n
science
\n
\n
\n
\n

\n FRIENDS &
FAMILY\n \n

\n
\n i am very greatful to god, to have such a butiful family and freinds they are thr best they always support me when i am down!\n
\n
\n \n \n \n \n
\n\n
\n
\n
\n

Welcome to
my website!

\n
\n
\n \n
\n \n
\n

\n \n","approvedDescription":"i made it basscily because i like doing stuff like edm or programming or gameig bassicly i am into computer and i am also into aviation and car industry!","studentName":"Annmay Shekhar","approvedCodeOrder":0,"fetchedAt":"2024-03-29T08:29:05.119Z","updatedAt":"2023-09-20T12:06:45.782Z","userApprovedCodeTagMappings":[],"languageType":"markup","status":"published","__keys":["fetchApprovedCodes"],"studentAvatar":"ozzy","userApprovedCodeTagMappingsMeta":{"count":0},"hotReactionCount":0,"id":"clk7szgr4000gx2m21wb187au","createdAt":"2023-07-18T04:37:19.909Z","studentGrade":"Grade7","approvedFileName":"profilo website","celebrateReactionCount":0}],"fetchStatus":{"fetchApprovedCodes":{"loading":false,"failure":false,"success":true,"stale":false},"fetchApprovedCodes/trending":{"loading":false,"failure":false,"success":true,"stale":false}},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"classroomSessions":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"cheatSheetTopics":{"data":[{"isSelected":true,"id":"cjx2czgja00001h2xt7fjlh04","title":"Intro to programming","order":1,"thumbnail":{"id":"ck9eaczkg00001lwyh6lkdimb","uri":"python/topic/thumbnail_cjx2czgja00001h2xt7fjlh04_1587738251519.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjx2tbg7k00071h2jr4rxnjc0","title":"Intro to variables","order":2,"thumbnail":{"id":"ck9eadkge00011lwyc5du6djy","uri":"python/topic/thumbnail_cjx2tbg7k00071h2jr4rxnjc0_1587738278597.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjx2uyu3u000k1h2jfwexw830","title":"Conditions","order":11,"thumbnail":{"id":"cjxr93uin001c1hyl4sqmky96","uri":"python/topic/thumbnail_cjx2uyu3u000k1h2jfwexw830_1562400817720.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjx2x6ie9000g1h28el7brjfn","title":"If-else","order":12,"thumbnail":{"id":"cjxr9431m001d1hyl3qjjorcx","uri":"python/topic/thumbnail_cjx2x6ie9000g1h28el7brjfn_1562400828770.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjx37okxu00081hz5nfl4sdyb","title":"Nested If-else","order":13,"thumbnail":{"id":"cjxr94fh4001e1hyl26jkr7bh","uri":"python/topic/thumbnail_cjx37okxu00081hz5nfl4sdyb_1562400844880.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjx37p3z000091hz54blwt4gy","title":"Elif","order":14,"thumbnail":{"id":"cjxr94nif001f1hyljfgurli1","uri":"python/topic/thumbnail_cjx37p3z000091hz54blwt4gy_1562400855296.png"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjx71ikma00081hx66rlxsmcn","title":"Assignment Statement","order":3,"thumbnail":{"id":"ck9eaeeqm00021lwy50wu74i3","uri":"python/topic/thumbnail_cjx71ikma00081hx66rlxsmcn_1587738317845.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types","order":4,"thumbnail":{"id":"ck9eag97f00031lwy7jkq9shs","uri":"python/topic/thumbnail_cjx722egv000h1hx65t1lawzt_1587738403991.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr7v4ud00001hyldvkg5dpg","title":"Naming a variable","order":5,"thumbnail":{"id":"ck9eah38300041lwy9ycs9lg5","uri":"python/topic/thumbnail_cjxr7v4ud00001hyldvkg5dpg_1587738442894.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr7xtr600011hylnzfxh3sw","title":"Operators","order":6,"thumbnail":{"id":"ck9eahm4p00051lwy48wa0fun","uri":"python/topic/thumbnail_cjxr7xtr600011hylnzfxh3sw_1587738467396.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr7yk5p00021hylg7ly9jya","title":"Intro to strings","order":7,"thumbnail":{"id":"ck9eairm600061lwydmht6ncf","uri":"python/topic/thumbnail_cjxr7yk5p00021hylg7ly9jya_1587738521146.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr80vyp00031hyls4kux618","title":"Input & Embedding","order":8,"thumbnail":{"id":"cjxr92g9d00171hyl5udsc3db","uri":"python/topic/thumbnail_cjxr80vyp00031hyls4kux618_1562400752587.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr81adf00041hyl0jv7d8ph","title":"String indexing","order":9,"thumbnail":{"id":"cjxr92vpy00191hylt2x7o3jg","uri":"python/topic/thumbnail_cjxr81adf00041hyl0jv7d8ph_1562400772623.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr81o1c00051hyl91rqe6iz","title":"Find & Replace functions","order":10,"thumbnail":{"id":"cjxr934x6001a1hylwh670rsq","uri":"python/topic/thumbnail_cjxr81o1c00051hyl91rqe6iz_1562400784549.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr83v7x00081hylz9nmmjio","title":"Intro to loops","order":15,"thumbnail":{"id":"ck9fl5hed00001lvpdfup2ht2","uri":"python/topic/thumbnail_cjxr83v7x00081hylz9nmmjio_1587816843333.png"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr842lv00091hylcqh3ypip","title":"For loop","order":17,"thumbnail":{"id":"cjxr96np5001j1hylfq41y35q","uri":"python/topic/thumbnail_cjxr842lv00091hylcqh3ypip_1562400948850.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr84jzu000b1hylqb8iisds","title":"For vs While loop","order":18,"thumbnail":{"id":"cjxr96tlw001k1hyl2x7ku11f","uri":"python/topic/thumbnail_cjxr84jzu000b1hylqb8iisds_1562400956510.jpeg"},"fetchedAt":"2024-03-29T07:11:51.596Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr84rsc000c1hyl5rojdnha","title":"Nested loop","order":19,"thumbnail":{"id":"ck9eak6t200071lwya4cq3f4q","uri":"python/topic/thumbnail_cjxr84rsc000c1hyl5rojdnha_1587738587505.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr850b7000d1hyldcqfp95t","title":"Break & Continue","order":20,"thumbnail":{"id":"cjxr984s1001m1hylld0fdq57","uri":"python/topic/thumbnail_cjxr850b7000d1hyldcqfp95t_1562401017644.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists","order":21,"thumbnail":{"id":"cjxr98jkf001o1hylnfzmr85t","uri":"python/topic/thumbnail_cjxr85ijr000f1hylxqfv47k8_1562401036806.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr85tdk000g1hyl65ottzbi","title":"Nested List","order":22,"thumbnail":{"id":"cjxr98t5p001p1hyl9pc2q7hj","uri":"python/topic/thumbnail_cjxr85tdk000g1hyl65ottzbi_1562401049238.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8d75v000h1hyl0cvj3xvi","title":"While loop","order":16,"thumbnail":{"id":"cjxr95n8e001i1hylopu63ql7","uri":"python/topic/thumbnail_cjxr8d75v000h1hyl0cvj3xvi_1562400901585.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations","order":23,"thumbnail":{"id":"cjxr994zh001q1hylwc00tgwq","uri":"python/topic/thumbnail_cjxr8ij5s000i1hyldqxb5uxj_1562401064563.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8jbl9000j1hyl2ci1lmj8","title":"Tuples","order":24,"thumbnail":{"id":"cjxr99blp001r1hyl2785jiro","uri":"python/topic/thumbnail_cjxr8jbl9000j1hyl2ci1lmj8_1562401073144.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8jnzo000k1hylx17j5vh9","title":"Sets","order":25,"thumbnail":{"id":"cjxr99iwa001s1hyl4ah91050","uri":"python/topic/thumbnail_cjxr8jnzo000k1hylx17j5vh9_1562401082594.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8jy9n000l1hyl9k8ugz6c","title":"Set Operations","order":26,"thumbnail":{"id":"cjxr99tfa001t1hyl523957r0","uri":"python/topic/thumbnail_cjxr8jy9n000l1hyl9k8ugz6c_1562401096236.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8k6w9000m1hylfim3d0m3","title":"Dictionary I","order":27,"thumbnail":{"id":"cjxr9a59z001u1hyljjx9itxi","uri":"python/topic/thumbnail_cjxr8k6w9000m1hylfim3d0m3_1562401111601.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8kegv000n1hyla36xi883","title":"Dictionary II","order":28,"thumbnail":{"id":"cjxr9aonr001v1hylckjer6id","uri":"python/topic/thumbnail_cjxr8kegv000n1hyla36xi883_1562401136721.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8knn4000o1hylzl5qtjxm","title":"Nested Dictionary","order":29,"thumbnail":{"id":"cjxr9aq2a001w1hylrs5lw25t","uri":"python/topic/thumbnail_cjxr8knn4000o1hylzl5qtjxm_1562401138538.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8kv2y000p1hylz4mmz213","title":"Dictionary Methods","order":30,"thumbnail":{"id":"cjxr9az42001x1hylzqw37is2","uri":"python/topic/thumbnail_cjxr8kv2y000p1hylz4mmz213_1562401150265.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8nv17000r1hyllt20n44u","title":"Functions","order":31,"thumbnail":{"id":"cjxr9bosg001z1hyl5oozz0u1","uri":"python/topic/thumbnail_cjxr8nv17000r1hyllt20n44u_1562401183547.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8o1zr000s1hyl2yuoxo0n","title":"Function Structure","order":32,"thumbnail":{"id":"cjyq7j7lr000n1hywp5yniegc","uri":"python/topic/thumbnail_cjxr8o1zr000s1hyl2yuoxo0n_1564514491421.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8o90l000t1hyltmu6vro1","title":"Function arguments","order":33,"thumbnail":{"id":"ck9fl627o00011lvp3p4x17be","uri":"python/topic/thumbnail_cjxr8o90l000t1hyltmu6vro1_1587816870313.png"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8oi1j000u1hyllatozhur","title":"Function Return","order":34,"thumbnail":{"id":"cjxr9d53n00211hylry8oifzp","uri":"python/topic/thumbnail_cjxr8oi1j000u1hyllatozhur_1562401251341.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8oszh000v1hylgc2kj1mu","title":"Variable Scope","order":35,"thumbnail":{"id":"ck9flj0w800031lvpd1nj4wip","uri":"python/topic/thumbnail_cjxr8oszh000v1hylgc2kj1mu_1587817475139.png"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8p0al000w1hylucda5ht0","title":"Recursion","order":36,"thumbnail":{"id":"cjxr9dp9g00231hylltkhp327","uri":"python/topic/thumbnail_cjxr8p0al000w1hylucda5ht0_1562401277464.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8pag8000x1hylbmhg0dzq","title":"Objects & Classes Intro","order":37,"thumbnail":{"id":"cjxr9ivgc00261hyl15p9gd9f","uri":"python/topic/thumbnail_cjxr8pag8000x1hylbmhg0dzq_1562401518772.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8pk69000y1hylefpn68tg","title":"Class Structure","order":38,"thumbnail":{"id":"cjxr9j2ae00271hylvpi0blg5","uri":"python/topic/thumbnail_cjxr8pk69000y1hylefpn68tg_1562401527631.jpeg"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]},{"isSelected":false,"id":"cjxr8pu4p000z1hylrt0zpw82","title":"Attributes & Methods","order":39,"thumbnail":{"id":"ck9fl7t1v00021lvpghtd7b2n","uri":"python/topic/thumbnail_cjxr8pu4p000z1hylrt0zpw82_1587816951755.png"},"fetchedAt":"2024-03-29T07:11:51.597Z","__keys":["getCheatSheet/default"]}],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"totalSchoolBatches":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userLearningObjective":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userVideo":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"schoolSessions":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userCourseCompletions":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"schoolStudentProfiles":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"questionBanks":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userCourseCertificate":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"dumpComicStrip":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"getClassroomReport":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userFirstAndLatestQuizReports":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"updateBatch":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"getHomeworkTitle":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"contentTags":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"calendarTimeRange":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"homeworkStudentsData":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"schoolClasses":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"learningSlide":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"studentReview":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"fetchQuizQuestions1":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"fetchPqStudentReport":{"data":null,"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"savedCode":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userQuizReport":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userInvite":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"currentCourse":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"sessionFeedbackTags":{"data":null,"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"schoolBatches":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"trendingUserApprovedCode":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userParent":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"fetchBatchSessionOtp":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"homeWorkMeta":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"classroomStudentsData":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"schoolProfile":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"mentorSession":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userQuizAnswers":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"eventCategories":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"adhocSessions":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"eventCertificates":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"eventSessions":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"recordingBatches":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"addMenteeSession":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"cheatSheetConcepts":{"data":[{"isSelected":true,"fetchedAt":"2024-03-29T08:53:40.062Z","order":1,"topic":{"id":"cjxr8oszh000v1hylgc2kj1mu","title":"Variable Scope"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8oszh000v1hylgc2kj1mu"],"title":"Scope","content":[{"order":1,"type":"text","statement":"The scope of a variable means the block of the program where you can use that variable.\n\nThe variable is only available from inside the region it is created, this is called the scope of the variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5it898006m0v1q6uufgbx6","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T08:53:40.062Z","order":2,"topic":{"id":"cjxr8oszh000v1hylgc2kj1mu","title":"Variable Scope"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8oszh000v1hylgc2kj1mu"],"title":"Global Variable","content":[{"order":1,"type":"text","statement":"You can use a global variable anywhere inside your program, even inside functions.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"var_name\ndef function_name():\n print(var_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"num1 = 1\nnum2 = 2\ndef add():\n print(num1+num2)\nadd()","terminalOutput":"3"}],"id":"cko5iumcw006o0v1q2x0a3455","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T08:53:40.062Z","order":3,"topic":{"id":"cjxr8oszh000v1hylgc2kj1mu","title":"Variable Scope"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8oszh000v1hylgc2kj1mu"],"title":"Local Variable","content":[{"order":1,"type":"text","statement":"The scope of a local variable is limited only to that particular block. \nFor example, a variable declared in a function can only be used in that particular function. \n\nA function cannot use the local variables from other functions.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5j13mu006s0v1q3pe0dygp","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T07:25:33.250Z","order":1,"topic":{"id":"cjxr81adf00041hyl0jv7d8ph","title":"String indexing"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81adf00041hyl0jv7d8ph"],"title":"Indexing","content":[{"order":1,"type":"text","statement":"Every character in a string is given a number that is called an index.\nWe can access each character of a string with help of these indices.\nThe first character has index 0, the second character has index 1, and so on.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"string_name[index number]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"greeting = \"\"Bonjour\"\"\n# B=0, o=1, n=2, j=3, o=4, u=5, r=6\nprint(greeting[6])","terminalOutput":"r"}],"id":"cko2xp65v00350vz158oa6vfp","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T07:25:33.250Z","order":2,"topic":{"id":"cjxr81adf00041hyl0jv7d8ph","title":"String indexing"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81adf00041hyl0jv7d8ph"],"title":"index() function","content":[{"order":1,"type":"text","statement":"index() function is used to get the index number of a particular character.\nIf the character occurs more than once in the string, the index of the first occurrence is given.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"string.index(value, start, end)\n\n#value - The character to search for.\n\n#start (Optional) - Index number to start the search from. Default is 0.\n\n#end (Optional) - Index number to end the search at. Default is to the end of the string.","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"prince_name = \"Prince Poppy\"\nprint(prince_name.index(\"i\"))\nprint(prince_name.index(\"p\"))","terminalOutput":"2\n9"}],"id":"cko2xpi3j00360vz1f7cchhad","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T07:25:33.250Z","order":3,"topic":{"id":"cjxr81adf00041hyl0jv7d8ph","title":"String indexing"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81adf00041hyl0jv7d8ph"],"title":"Negative Indexing","content":[{"order":1,"type":"text","statement":"Python numbers the characters of a string in two ways, forward and backward.\nWhile numbering backward, Python gives the characters a negative index starting from -1 for the last character in the string.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"funny_prince = 'Prince Poppy'\nprint(funny_prince[-1])\nprint(funny_prince[-4])","terminalOutput":"y\no"}],"id":"cko2xpy3g00370vz13alt9156","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T07:25:33.250Z","order":4,"topic":{"id":"cjxr81adf00041hyl0jv7d8ph","title":"String indexing"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81adf00041hyl0jv7d8ph"],"title":"Strings are immutable","content":[{"order":1,"type":"text","statement":"Python does not allow to change any character in a string.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"greeting = \"Hey, man!\"\ngreeting[0] = \"C\"\nprint(greeting)","terminalOutput":"TypeError: 'str' object does not support item assignment"}],"id":"cko2xq6pp00380vz1btgt9xj1","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T07:25:33.251Z","order":5,"topic":{"id":"cjxr81adf00041hyl0jv7d8ph","title":"String indexing"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81adf00041hyl0jv7d8ph"],"title":"Slicing a string","content":[{"order":1,"type":"text","statement":"Slicing - We get a part of the string from the starting index to the character previous to the ending index.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"string_name[starting index:ending index]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"text","statement":"We can also slice a string up to the last letter.\nBy not specifying the ending index, Python automatically takes the last letter of the string as the endpoint.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"syntax","statement":null,"syntax":"string_name[starting index:]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"text","statement":"Similarly not giving a starting index, means Python will take the index of the first letter in the string.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":6,"type":"syntax","statement":null,"syntax":"string_name[:ending index]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":7,"type":"text","statement":"Similarly not giving any index means Python will take the entire string.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":8,"type":"syntax","statement":null,"syntax":"string_name[:]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":9,"type":"text","statement":"Python can also skip letters in between while slicing. We use two colons for that.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":10,"type":"syntax","statement":null,"syntax":"string_name[::step]\n#If step is 3, python will print every third character only.","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":11,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"word = 'helipad'\nprint(word[2:6])\n\nword = 'helipad'\nprint(word[2:])\n\nword = 'helipad'\nprint(word[:6])\n\nword = 'helipad'\nprint(word[:])\n\nword = 'helipad'\nprint(word[::2])\n#python prints every second character","terminalOutput":"lipa\nlipad\nhelipa\nhelipad\nhlpd"}],"id":"cko2xqe0q00390vz13d5g2uy3","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T07:25:33.251Z","order":6,"topic":{"id":"cjxr81adf00041hyl0jv7d8ph","title":"String indexing"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81adf00041hyl0jv7d8ph"],"title":"Length of the string - len()","content":[{"order":1,"type":"text","statement":"Python counts and returns the number of characters in a string using len() function.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"len(string_variable)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"word = 'helipad'\nprint(len(word))\n\nword = 'helipad'\nlength = len(word)\nprint(word[2:length]\n#we saved the length of the word using the len() function, then we sliced the word from 2 to 7.","terminalOutput":"7\nlipad"}],"id":"cko2xqm30003a0vz1ftue02q6","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T07:11:51.597Z","order":1,"topic":{"id":"cjx2czgja00001h2xt7fjlh04","title":"Intro to programming"},"userCheatSheetId":"","status":"unpublished","__keys":["getCheatSheet/default","cheatSheetConcepts/cjx2czgja00001h2xt7fjlh04"],"title":"print()","content":[{"order":1,"type":"text","statement":"Displays a printable value or information in the output console.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"print(\"value\")","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(\"Hello\")\nprint(5)","terminalOutput":"Hello\n5"}],"id":"cko13ubxd00090vxi7kyjbk4v","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T07:11:51.597Z","order":2,"topic":{"id":"cjx2czgja00001h2xt7fjlh04","title":"Intro to programming"},"userCheatSheetId":"","status":"unpublished","__keys":["getCheatSheet/default","cheatSheetConcepts/cjx2czgja00001h2xt7fjlh04"],"title":"sep","content":[{"order":1,"type":"text","statement":"Separates different words/entities with any string value.\nIf the sep command is not used, python by default gives space (whitespace) as the default separator.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":"print(\"box1\",\"box2\", sep = \"symbol\")","syntax":"print(\"box1\",\"box2\", sep = \"symbol\")","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(1,\"how\"\"are\", \"you doing\", sep = \"#\")","terminalOutput":"1#howare#you doing"}],"id":"cko140988000f0vxicag2bakd","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T07:11:51.598Z","order":3,"topic":{"id":"cjx2czgja00001h2xt7fjlh04","title":"Intro to programming"},"userCheatSheetId":"","status":"unpublished","__keys":["getCheatSheet/default","cheatSheetConcepts/cjx2czgja00001h2xt7fjlh04"],"title":"end","content":[{"order":1,"type":"text","statement":"Adds the given symbol at the end of the statement.\nIf the end command is not used, python by default goes to the next line.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"print(\"box\" , end = \"symbol\")","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(\"How are you\", end = \"?\" )","terminalOutput":"How are you?"}],"id":"cko140djb000g0vxi5jlj13n3","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T07:09:52.424Z","order":1,"topic":{"id":"cjxr8d75v000h1hyl0cvj3xvi","title":"While loop"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8d75v000h1hyl0cvj3xvi"],"title":"while loop","content":[{"order":1,"type":"text","statement":"While allows a programmer to repeat a block of statements for the TRUE condition.\n\nIt verifies the condition before executing the loop.\nThe code inside while block is repeated as long as the given condition remains True.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"while expression1:\n Statement1\n (Incrementing the value if required)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"percentage = 0\nwhile percentage <= 100:\n print('Hacking 10:68:3f:52:71:5b', percentage, '%')\n percentage = percentage + 25\n\n#Python runs this line after the loop stops.\nprint(\"System hacked, and you're under the watch of the Red Eye now!\")","terminalOutput":"Hacking 10:68:3f:52:71:5b 0 %\nHacking 10:68:3f:52:71:5b 25 %\nHacking 10:68:3f:52:71:5b 50 %\nHacking 10:68:3f:52:71:5b 75 %\nHacking 10:68:3f:52:71:5b 100 %\nSystem hacked, and you're under the watch of the Red Eye now!"}],"id":"cko3yddtz003a0vynhyjzafpc","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T06:56:14.387Z","order":1,"topic":{"id":"cjxr8knn4000o1hylzl5qtjxm","title":"Nested Dictionary"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8knn4000o1hylzl5qtjxm"],"title":"Nested Dictionary","content":[{"order":1,"type":"text","statement":"You can store the multiple values in a list, and use the list variable as the value to the key.\n\nYou can also you other data structures like tuple, set, or even another dictionary to create a nested dictionary.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name = { key : list_variable }","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"list_age = [14, 21]\ndict_1 = { 'ages' : list_age }\nprint(dict_1)","terminalOutput":"{ 'ages' : [14, 21] }"}],"id":"cko4onch4002c0v1q7gaugjr3","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T06:56:14.388Z","order":2,"topic":{"id":"cjxr8knn4000o1hylzl5qtjxm","title":"Nested Dictionary"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8knn4000o1hylzl5qtjxm"],"title":"Accessing the values of nested dictionary","content":[{"order":1,"type":"text","statement":"Since a list or another data structure is stored as a value, we first access it as the value of the key in the Dictionary, and then we access the index/key of that data structure to get the value we want.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"print(dict_name[key][index])","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"list_age = [14, 21]\ndict_1 = { 'ages' : list_age }\nprint(dict_1['ages'][0])\n\ndict_in_dict = {\n 'students':{\n 1:'Theo',\n 2:'Ron',\n 3:'Harry'\n }\n}\nprint(dict_in_dict['students'][1])","terminalOutput":"14\nTheo"}],"id":"cko4oy3nb002g0v1qgiyp8cb2","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T06:49:51.516Z","order":1,"topic":{"id":"cjxr83v7x00081hylz9nmmjio","title":"Intro to loops"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr83v7x00081hylz9nmmjio"],"title":"loops","content":[{"order":1,"type":"text","statement":"Using loops, we can make Python repeat the set instructions again and again.\n\nThe set of instructions inside a loop will be repeated until a particular condition remains True. As soon as the given condition becomes False, the program breaks / comes out of the loop.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko3y7olo00380vyn7j2o33s9","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T06:38:29.118Z","order":1,"topic":{"id":"cjxr8o90l000t1hyltmu6vro1","title":"Function arguments"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8o90l000t1hyltmu6vro1"],"title":"Arguments/Parameters","content":[{"order":1,"type":"text","statement":"Arguments are the input for a function.\nThey are given inside the parentheses ( ) in a function.\nThese values can be used within the function.\nThe number of arguments required in a function is defined while we create a function.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"def function_name(arguments):\n ","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"def add(num1, num2):\n total = num1 + num2\n print(total)\nadd(1,2)","terminalOutput":"3"}],"id":"cko5hyegw005z0v1q8icn3ema","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T06:38:29.118Z","order":2,"topic":{"id":"cjxr8o90l000t1hyltmu6vro1","title":"Function arguments"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8o90l000t1hyltmu6vro1"],"title":"List as arguments","content":[{"order":1,"type":"text","statement":"Instead of giving multiple arguments, we can pass a list as a single argument that holds multiple values.\nThe list is then accessed inside the function via indexing.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"def function_name(list_argument):\n ","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"my_list = [1,2]\ndef add(list_num):\n total = 0\n for i in list_num:\n total = total + i\n print(total)\nadd(my_list)\n#my_list will be passed to list_num, and it will be used inside the function","terminalOutput":"3"}],"id":"cko5i04nj00640v1q8r186vmk","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T06:38:29.118Z","order":3,"topic":{"id":"cjxr8o90l000t1hyltmu6vro1","title":"Function arguments"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8o90l000t1hyltmu6vro1"],"title":"*args","content":[{"order":1,"type":"text","statement":"By passing *args as an argument to a function, Python allows us to pass any number of arguments to a function, and it will store them in args like a List.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"def function_name(*args):\n ","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"def add(*args):\n total=0\n for i in args:\n total = total + i\n print(total)\nadd(1,2,3,4)","terminalOutput":"10"}],"id":"cko5i24h100680v1qbu71eni3","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T05:33:49.409Z","order":1,"topic":{"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8"],"title":"Lists","content":[{"order":1,"type":"text","statement":"Lists are used to store values of the same/different types in one variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_name=[value1, value2, value3,....]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"person_1 = ['David', 12, 'Miami']\nprint(person_1)","terminalOutput":"['David', 12, 'Miami']"}],"id":"cko4a6q1h000x0vx47efj3m2l","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T05:33:49.409Z","order":2,"topic":{"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8"],"title":"Indexing in Lists","content":[{"order":1,"type":"text","statement":"List items can be numbered in the same way as strings (indexing).","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_name[index_number]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"vowels = ['a', 'e', 'i', 'o', 'u']\nprint(vowels[3])\nprint(vowels[-3])#negative indexing is possible in lists\n#-ve index-backward indexing","terminalOutput":"o\ni"}],"id":"cko4a8dc700170vx42k1uce9g","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T05:33:49.410Z","order":3,"topic":{"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8"],"title":"Slicing","content":[{"order":1,"type":"text","statement":"Lists can be sliced again in the same way as strings.\nWe get a slice of the list or sublist by giving the starting and ending index. \nThe ending index item does not get counted.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_name[starting index: ending index]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"vowels = ['a', 'e', 'i', 'o', 'u']\nprint(vowels[2:5])","terminalOutput":"['i', 'o', 'u']"}],"id":"cko4ey1wy001v0vx44eu99uev","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T05:33:49.410Z","order":4,"topic":{"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8"],"title":"Looping in list","content":[{"order":1,"type":"text","statement":"Lists can be iterated over by using a loop in the same way as strings.\nEach time the looping variable holds the value of each element in the list.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_name=[item1,item2,item3,...]\nfor item in list_name:\n print(item)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"vowels = ['a', 'e', 'i', 'o', 'u']\nfor letter in vowels:\n print(letter)","terminalOutput":"a\ne\ni\no\nu"},{"order":4,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"vowels = ['a', 'e', 'i', 'o', 'u']\nprint('b' in vowels)","terminalOutput":"False"}],"id":"cko4eyazy001w0vx49xon4ye2","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T05:33:49.410Z","order":5,"topic":{"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8"],"title":"Lists are mutable","content":[{"order":1,"type":"text","statement":"In lists, items can be changed by specifying their index. \nThis cannot be done in strings.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_name[index] = value","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"text","statement":"If the starting and ending index of the list while slicing are the same, Python adds the values between the starting index and the ending index without replacing the value already present at the same index of the list.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"syntax","statement":null,"syntax":"list_name[starting index: starting index] = [value1,value2]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"numbers = [1,2,3,4,5]\nnumbers[0] = ‘111’\nprint(numbers)\n\na = [1, 2, 5, 6]\na[2:2] = [3, 4]\nprint(a)","terminalOutput":"[‘111’, 2, 3, 4, 5]\n[1, 2, 3, 4, 5, 6]"}],"id":"cko4ezx9m001x0vx49uaxf7gu","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T05:33:49.410Z","order":6,"topic":{"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8"],"title":"Joining lists","content":[{"order":1,"type":"text","statement":"Two or more lists can be joined or concatenated using the + operator.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_3=list_1+list2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"list_1 = [1, 2]\nlist_2 = [3, 4]\nprint(list_1 + list_2)","terminalOutput":"[1, 2, 3, 4]"}],"id":"cko4f075h001y0vx42oad5zh1","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T05:33:49.410Z","order":7,"topic":{"id":"cjxr85ijr000f1hylxqfv47k8","title":"Lists"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8"],"title":"Repeating lists","content":[{"order":1,"type":"text","statement":"Lists can be repeated many times using the * symbol.\nWe can only use integer after the * symbol, using a float value would raise an error.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list2=list1*integer_number","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"list_1 = [1, 2, 3]\nprint(list * 2)\n\nnested_list = [1, 2, [3, 4]]\nprint(nested_list * 2)","terminalOutput":"[1, 2, 3, 1, 2, 3]\n[1, 2, [3, 4], 1, 2, [3, 4]]"}],"id":"cko4f0l2f001z0vx48ojdbxqp","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T05:28:21.517Z","order":1,"topic":{"id":"cjx37okxu00081hz5nfl4sdyb","title":"Nested If-else"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx37okxu00081hz5nfl4sdyb"],"title":"Nesting","content":[{"order":1,"type":"text","statement":"NESTING\nNesting is the process of adding an if-else statement within another if-else. The second statement gets evaluated when the first condition is True.\n \nThe first if statement is commonly called as \"outer if\" and the block within it is called \"nested / inner if\".","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"if condition1:\n if condition2:\n StatementA\n else:\n StatementB\nelse:\n if condition3:\n StatementC\n else:\n StatementD","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"age=10\nheight=160\nif age >= 10:\n if height > 150:\n print('You get roller coaster!')\n else:\n print('You get water rides!')\nelse:\n print('Sorry, no rides for you!')","terminalOutput":"You get roller coaster!"}],"id":"cko3sqr7z001x0vyn5imnfx7c","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T04:20:43.516Z","order":1,"topic":{"id":"cjxr8jy9n000l1hyl9k8ugz6c","title":"Set Operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jy9n000l1hyl9k8ugz6c"],"title":"union() Function","content":[{"order":1,"type":"text","statement":"The union() method combines all the elements of two or more sets into a single set.\nYou can add multiple sets as arguments inside the union() function to get the union.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"set_union = set_1.union(set_2, set_3)\n#same as set_union = set_2.union(set_1, set_3)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"set_1 = {1, 2, 3}\nset_2 = {2, 3, 4}\nset_union = set_1.union(set_2)\nprint(set_union)","terminalOutput":"{1, 2, 3, 4}"}],"id":"cko4kh00300110v1qf58v7s08","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T04:20:43.517Z","order":2,"topic":{"id":"cjxr8jy9n000l1hyl9k8ugz6c","title":"Set Operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jy9n000l1hyl9k8ugz6c"],"title":"intersection() Function","content":[{"order":1,"type":"text","statement":"The intersection() method finds the common elements between two or more sets and stores them in a single set.\n\nYou can add multiple sets as arguments inside the intersection() function to get the intersection.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"set_intersect = set_1.intersection(set_2, set_3)\n#same as set_intersect = set_2.intesection(set_1, set_3)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"set_1 = {1, 2, 3}\nset_2 = {2, 3, 4}\nset_intersect = set_1.intersection(set_2)\nprint(set_intersect)","terminalOutput":"{2,3}"}],"id":"cko4knha500160v1q9qdv17mj","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T04:20:43.518Z","order":3,"topic":{"id":"cjxr8jy9n000l1hyl9k8ugz6c","title":"Set Operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jy9n000l1hyl9k8ugz6c"],"title":"difference() Method","content":[{"order":1,"type":"text","statement":"The difference() method removes the common elements between two or more sets. \n\nIt returns a set with elements present in the first set, but not in others.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"set_diff = set_1.difference(set_2)\n#returns set_1 - set_2\nset_diff = set_2.difference(set_1)\n#returns set_2 - set_1","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"set_1 = {1, 2, 3}\nset_2 = {2, 3, 4}\nset_diff = set_1.difference(set_2, set_3)\nprint(set_diff)","terminalOutput":"{1}"}],"id":"cko4l5jsi001a0v1q5twabt6z","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T04:20:43.518Z","order":4,"topic":{"id":"cjxr8jy9n000l1hyl9k8ugz6c","title":"Set Operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jy9n000l1hyl9k8ugz6c"],"title":"add() Function","content":[{"order":1,"type":"text","statement":"add() function can be used to add an element to a set.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"set_name.add(element)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"set_1 = {1, 2, 3}\nset_1.add(4)\nprint(set_1)","terminalOutput":"{1, 2, 3, 4}"}],"id":"cko4lmj46001e0v1q0bgpfwnu","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T04:20:43.518Z","order":5,"topic":{"id":"cjxr8jy9n000l1hyl9k8ugz6c","title":"Set Operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jy9n000l1hyl9k8ugz6c"],"title":"discard() Function","content":[{"order":1,"type":"text","statement":"discard() function can be used to remove an element from a set.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"set_name.discard(element)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"set_1 = {1, 2, 3}\nset_1.discard(2)\nprint(set_1)","terminalOutput":"{1, 3}"}],"id":"cko4lofwo001i0v1qhqnxap7p","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T04:20:43.518Z","order":6,"topic":{"id":"cjxr8jy9n000l1hyl9k8ugz6c","title":"Set Operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jy9n000l1hyl9k8ugz6c"],"title":"copy() Function","content":[{"order":1,"type":"text","statement":"copy() function allows you to make a copy of a set. \n\nNote - new_set = old_set does not work, it will just give a new name to the old set, it will not create a new copy.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"new_set=old_set.copy()","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"set_1 = {1, 2, 3}\nset_new=set_1.copy()\nprint(set_new)","terminalOutput":"{1, 2, 3}"}],"id":"cko4lpyuk001m0v1q98ks1szf","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T03:48:57.434Z","order":1,"topic":{"id":"cjx2x6ie9000g1h28el7brjfn","title":"If-else"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx2x6ie9000g1h28el7brjfn"],"title":"Block and Indentation","content":[{"order":1,"type":"text","statement":"Codes can be written inside blocks. So python runs only a particular block of code.\nIndentation refers to a fixed amount of space added at the beginning of the code that indicates a particular block of code.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko387sql000l0vynaqoudjpx","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:48:57.435Z","order":2,"topic":{"id":"cjx2x6ie9000g1h28el7brjfn","title":"If-else"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx2x6ie9000g1h28el7brjfn"],"title":"if else block","content":[{"order":1,"type":"text","statement":"The if-else statement in Python executes either the True or the False part of a given condition.\n\nIf the condition is True, the if block executes, and if the condition is False, the else block executes.\n\nIt is not necessary to have an else condition.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"if condition1:\n Statement1\nelse:\n Statement2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"number = 99\nif number>0:\n print(\"Positive Number\")\nelse:\n print(\"Negative Number\")","terminalOutput":"Positive Number"}],"id":"cko3q7qyy001h0vynh6jo45h0","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:48:57.435Z","order":3,"topic":{"id":"cjx2x6ie9000g1h28el7brjfn","title":"If-else"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx2x6ie9000g1h28el7brjfn"],"title":"Flowchart","content":[{"order":1,"type":"text","statement":"It is a diagram showing the flow of the program.\nIt is a blueprint of the program written.\n\nCertain shapes are used to draw flowcharts, and these shapes have the meaning as follows.\nOval - Start/Stop\nRectangle - To perform assignment statements\nParallelogram - To take input and use print commands\nDiamond - To evaluate a condition\nArrows - To show the flow of the program","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"image","statement":null,"syntax":null,"image":{"id":"cko3qznh7001q0vynazxd6kdx","uri":"python/cheatsheetcontent/image_cko3qzg2m001p0vyncsm6d470_1619752789880.gif"},"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko3q817n001i0vynanc7e7eo","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T03:45:56.151Z","order":1,"topic":{"id":"cjxr8pag8000x1hylbmhg0dzq","title":"Objects & Classes Intro"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pag8000x1hylbmhg0dzq"],"title":"Class","content":[{"order":1,"type":"text","statement":"Class is a model or a blueprint of an object in real life. \nFor eg. Car, Person, etc","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5jsa44006z0v1q0a5jh36y","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:45:56.151Z","order":2,"topic":{"id":"cjxr8pag8000x1hylbmhg0dzq","title":"Objects & Classes Intro"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pag8000x1hylbmhg0dzq"],"title":"Object/Instances","content":[{"order":1,"type":"text","statement":"Objects are created from a Class. \nThey are the collection of data (variables) and methods (functions) that act on those variables.\n\nMultiple Objects can be created from the same class. \nFor example, a class Car can have objects like Maruti, Honda, etc.\nObjects are created by giving details (attributes) to a model(class).","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5jt6qg00710v1q3poh5bcu","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:45:56.152Z","order":3,"topic":{"id":"cjxr8pag8000x1hylbmhg0dzq","title":"Objects & Classes Intro"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pag8000x1hylbmhg0dzq"],"title":"Attributes","content":[{"order":1,"type":"text","statement":"Attributes are the variables used inside a class, that describe the real-life object. \nFor example, a class Car can have attributes like the model, color, price, etc.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5juguh00730v1q3mnwddkh","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:45:56.152Z","order":4,"topic":{"id":"cjxr8pag8000x1hylbmhg0dzq","title":"Objects & Classes Intro"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pag8000x1hylbmhg0dzq"],"title":"Methods","content":[{"order":1,"type":"text","statement":"A function created inside a class is called a method.\nFor example, Class car can have methods like start(), stop(), brake(), park(), etc.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5jvfig00750v1qa8da8hq1","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T03:43:02.605Z","order":1,"topic":{"id":"cjxr8pu4p000z1hylrt0zpw82","title":"Attributes & Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pu4p000z1hylrt0zpw82"],"title":"Class Attributes","content":[{"order":1,"type":"text","statement":"The value of class attributes remain the same for all the objects created from the class.\nThese are initialized outside the class Constructor.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"class class_name:\n attribute_1 = value #this is a class attribute\n def __init__(self, attribute_2):\n self.attribute_2 = attribute_2 \n #this is an instance attribute","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"class Car:\n mfg_year = 2021\n def __init__(self, name, color, price):\n self.name = name\n self.color = color\n self.price = price\nhonda = Car(\"Honda\", \"Red\", 3500)\nprint(honda.name, honda.color, honda.price, honda.mfg_year)","terminalOutput":"Honda Red 3500 2021"}],"id":"cko5m269x009o0v1q9jmu5cul","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:43:02.605Z","order":2,"topic":{"id":"cjxr8pu4p000z1hylrt0zpw82","title":"Attributes & Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pu4p000z1hylrt0zpw82"],"title":"Instance Attribute","content":[{"order":1,"type":"text","statement":"The value of instance attributes change for different objects created from that class. \n\nThey are initialized inside the class Constructor.\nWe can use these attributes by using the object name.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"object_name.attribute_name","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5mekcq009u0v1qf067bbng","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:43:02.605Z","order":3,"topic":{"id":"cjxr8pu4p000z1hylrt0zpw82","title":"Attributes & Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pu4p000z1hylrt0zpw82"],"title":"Calling a Method","content":[{"order":1,"type":"text","statement":"An object can call the methods inside a class.\nWhen a method is called, the object name is sent to \"self\" and hence the instance attributes can be accessed.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"object_name.method_name(arguments)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"class Car:\n mfg_year = 2021\n def __init__(self, name, color, price):\n self.name = name\n self.color = color\n self.price = price\n def drive(self, speed):\n print(\"Driving\", self.name, \"at\", speed, \"kmph\")\nhonda = Car(\"Honda\", \"Red\", 3500)\nhonda.drive(50)","terminalOutput":"Driving Honda at 50 kmph"}],"id":"cko5mgl9g009x0v1qaahebc3g","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T03:20:47.944Z","order":1,"topic":{"id":"cjxr8jnzo000k1hylx17j5vh9","title":"Sets"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jnzo000k1hylx17j5vh9"],"title":"Sets","content":[{"order":1,"type":"text","statement":"A set is a collection that is both unordered and unindexed. \nSets are defined with curly {} brackets. \nThey cannot have two items with the same value. The value is stored only once. \nIt is a very useful tool to remove repeated values.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"set_name={values}","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"set1 = {\"apple\", \"banana\", \"cherry\"}\nset2 = {1, 5, 7, 9, 3}\nset3 = {True, False, False}\n\nprint(set1)\nprint(set2)\nprint(set3)","terminalOutput":"{'cherry', 'apple', 'banana'}\n{1, 3, 5, 7, 9}\n{False, True}"}],"id":"cko4j793h000t0v1q26spege9","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T03:20:47.945Z","order":2,"topic":{"id":"cjxr8jnzo000k1hylx17j5vh9","title":"Sets"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jnzo000k1hylx17j5vh9"],"title":"Conversion of List/Tuple to Set","content":[{"order":1,"type":"text","statement":"The set() function is used to convert a list/tuple to a set. \nIt removes any repeated elements of the list/tuple and stores them only once.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_to_set = set(list)\ntuple_to_set = set(tuple)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"list_to_set = set([1,2,1,4,2])\ntuple_to_set = set(('a', 'b', 'c'))\nprint(list_to_set)\nprint(tuple_to_set)","terminalOutput":"{1, 2, 4}\n{'a', 'b', 'c'}"}],"id":"cko4jlt3t000x0v1qb30k8ylv","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T02:35:47.696Z","order":1,"topic":{"id":"cjxr8p0al000w1hylucda5ht0","title":"Recursion"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8p0al000w1hylucda5ht0"],"title":"Definition","content":[{"order":1,"type":"text","statement":"Recursion means a function calls itself inside the function body.\n\nThe function keeps on calling itself until it gets a return value at some point. And then all the functions that were called, get their respective return values.\n \nCheck the call_for_lunch() example.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"def call_for_lunch(friend1) :\n print(\"Time for lunch?\")\n def call_for_lunch(friend2) :\n print(\"Time for lunch?\")\n return 10\n return time\n#Here friend2 is the base case, as they give a return value 10, and that is passed on to friend1, and they return the same value here.","terminalOutput":null}],"id":"cko5j968c006u0v1qgxde4902","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T02:35:47.697Z","order":2,"topic":{"id":"cjxr8p0al000w1hylucda5ht0","title":"Recursion"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8p0al000w1hylucda5ht0"],"title":"Base Case","content":[{"order":1,"type":"text","statement":"The innermost point of recursion, which gives the first proper return value, is called the base case.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5jr1om006x0v1q7si1et9s","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T01:11:22.413Z","order":1,"topic":{"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx722egv000h1hx65t1lawzt"],"title":"Data Types","content":[{"order":1,"type":"text","statement":"Python has the following data types built-in by default\n\nInteger (int) - Data type to store non-decimal numbers in a variable.\n\nFloat (float) - Data type to store decimal point numbers in a variable.\n\nString (str) - Data type to store words and characters in a variable.\n\nBoolean (bool) - Data type that stores two values: True and False in a variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko1b19li001m0vxigvi9aiif","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T01:11:22.413Z","order":2,"topic":{"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx722egv000h1hx65t1lawzt"],"title":"type()","content":[{"order":1,"type":"text","statement":"Gives you the data type of the value held by the variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"type(variable_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"integer_ = 5\nprint(type(integer_))\n\nstring_ = \"Hello, Welcome to Tekie\"\nprint(type(string_))","terminalOutput":"\n"}],"id":"cko1b1rxu001o0vxidk1pc2qc","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T01:11:22.413Z","order":3,"topic":{"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx722egv000h1hx65t1lawzt"],"title":"Type Casting","content":[{"order":1,"type":"text","statement":"Changes the data type of one variable to another data type.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko1b2091001p0vxid6kn4pvx","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T01:11:22.413Z","order":4,"topic":{"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx722egv000h1hx65t1lawzt"],"title":"int()","content":[{"order":1,"type":"text","statement":"Converts to integer data type from - \n1) Integer\n2) Float (by removing the decimal point and everything after it)\n3) String (only if string represents a number)\n4) Boolean - Converts True to 1, and False to 0","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"int(variable_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"number = int(\"8\")\nprint(number, type(number))\n\nnumber=int(\"Tekie\")","terminalOutput":"8 \nValueError: invalid literal for int() with base 10: 'Tekie'"}],"id":"cko1b26rw001q0vxi6uuy9jc2","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T01:11:22.414Z","order":5,"topic":{"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx722egv000h1hx65t1lawzt"],"title":"str()","content":[{"order":1,"type":"text","statement":"Converts to string data type from all the data types including float, integer, boolean and string.`","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"str(variable_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"num = str(5)\nprint(num , type(num))\nnum = str(7.2)\nprint(num , type(num))","terminalOutput":"5 \n7.2 "}],"id":"cko1b2dcq001r0vxi7mkadofj","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T01:11:22.414Z","order":6,"topic":{"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx722egv000h1hx65t1lawzt"],"title":"float()","content":[{"order":1,"type":"text","statement":"Converts to float data type from - \n1) Integer\n2) String (only if the string represents a float or an integer)\n3) Float","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"float(variable_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"a=float(10)\nprint(a)\n\nb=float(\"10.2\")\nprint(b)\n\nc=float(\"Hello\")\nprint(c)","terminalOutput":"10.0\n10.2\nValueError: could not convert string to float: 'Hello'"}],"id":"cko1b2lef001s0vxih05r5sw4","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T01:11:22.414Z","order":7,"topic":{"id":"cjx722egv000h1hx65t1lawzt","title":"Data Types"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx722egv000h1hx65t1lawzt"],"title":"bool()","content":[{"order":1,"type":"text","statement":"Converts to boolean data type from - \n1) Integer (If the value of the variable is 0, then prints False. Otherwise prints True)\n2) String (If the string is empty, then prints False. Otherwise prints True)","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"bool(variable_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"a=bool(0)\nb=bool(1)\nc=bool(\"\")\nd=bool(\"Python\")\nprint(a,b,c,d)","terminalOutput":"False True False True"}],"id":"cko1b2tyr002z0vxi5w9g96oq","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T00:46:59.240Z","order":1,"topic":{"id":"cjxr8pk69000y1hylefpn68tg","title":"Class Structure"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pk69000y1hylefpn68tg"],"title":"Creating a Class","content":[{"order":1,"type":"text","statement":"In Python, the keyword \"class\" is used to define a class. \nAll the class methods and attributes under a class need to be indented.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"class class_name:\n attributes\n def function_name():\nobject_name = class_name(attributes)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"class Car:\n mfg_year = 2021\n#this attribute will not change for the objects, so we can initialize it here\n def start(self):\n print(\"Car started\")","terminalOutput":null}],"id":"cko5jx77m00770v1qaiy44wd9","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T00:46:59.241Z","order":2,"topic":{"id":"cjxr8pk69000y1hylefpn68tg","title":"Class Structure"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pk69000y1hylefpn68tg"],"title":"Methods of a class","content":[{"order":1,"type":"text","statement":"A 'self' argument is passed when a method is created. It is used to link an object of the class to the methods of that class.\nThe name of the object is passed as \"self\".","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5l0238007e0v1q1b491aet","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T00:46:59.241Z","order":3,"topic":{"id":"cjxr8pk69000y1hylefpn68tg","title":"Class Structure"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8pk69000y1hylefpn68tg"],"title":"Constructor","content":[{"order":1,"type":"text","statement":"The special method with the name \"__init__\" is the class Constructor. \n\nWhenever an object is created, this method is automatically called by default, and you can initialize the attributes inside the constructor, as different objects can have different attributes.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"class Class_Name:\n def __init__(self, attribute_1, attribute_2):\n self.attribute_1 = attribute_1\n self.attribute_2 = attribute_2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"class Car:\n def __init__(self, name, color, price):\n self.name = name\n self.color = color\n self.price = price\nhonda = Car(\"Honda\", \"Red\", 3500)\nprint(honda.name, honda.color, honda.price)","terminalOutput":"Honda Red 3500"}],"id":"cko5lvxjh009k0v1q2zqd3ell","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T00:36:22.442Z","order":1,"topic":{"id":"cjxr84jzu000b1hylqb8iisds","title":"For vs While loop"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr84jzu000b1hylqb8iisds"],"title":"Comparision between For and While Loops","content":[{"order":1,"type":"text","statement":"For Loop\nFor loop is usually called a Counting loop, because we specify the number of times we want to run the loop beforehand.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"text","statement":"While loop\nWhile loop is usually called a conditional loop because it depends on a condition. It runs as long as the condition remains true, and it breaks when the condition becomes false.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"for val in string:\n ","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"syntax","statement":null,"syntax":"while :\n ","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"for x in \"banana\":\n print(x)","terminalOutput":"b\na\nn\na\nn\na"},{"order":6,"type":"terminal","statement":"master = 'ZOG'\nindex = 0\nwhile index < len(master):\n letter=master[index] \n print(letter)\n index=index+1","syntax":null,"image":null,"emoji":[],"terminalInput":"master = 'ZOG'\nindex = 0\nwhile index < len(master):\n letter=master[index] \n print(letter)\n index=index+1","terminalOutput":"Z\nO\nG"}],"id":"cko3z29tc003q0vyn0ti7fuz4","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T00:32:04.665Z","order":1,"topic":{"id":"cjxr8kegv000n1hyla36xi883","title":"Dictionary II"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8kegv000n1hyla36xi883"],"title":"Dictionary Keys","content":[{"order":1,"type":"text","statement":"Dictionaries do not have indexing, but they have keys, which are very similar to indexing. \n\nAdding values to a dictionary can be done in the same way using keys like it is done with indexing. \n\nIf you use the same key again and give another value, it will remove the old value and store the new value for the key.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name[key] = value","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_1 = {}\n#empty dictionary\ndict_1['mobile'] = 'iPhone'\nprint(dict_1)\ndict_1['mobile'] = 'OnePlus'\nprint(dict_1)","terminalOutput":"{'mobile': 'iPhone'}\n{'mobile': 'OnePlus'}"}],"id":"cko4mczw7001u0v1qch107td1","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-29T00:32:04.665Z","order":2,"topic":{"id":"cjxr8kegv000n1hyla36xi883","title":"Dictionary II"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8kegv000n1hyla36xi883"],"title":"Check if a Key is present","content":[{"order":1,"type":"text","statement":"The 'in' feature can be used to check whether a key is present in a Dictionary.\nAs it is a conditional statement, if the key is present it returns True else it returns False.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"print(key in dict_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_1 = { 'Theo' : 7717234567, 'Zo' : 8211132111 }\nprint('Zo' in dict_1)\nprint('Tyra' in dict_1)","terminalOutput":"True\nFalse"}],"id":"cko4ml5de001y0v1qc3tm54fm","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-29T00:25:42.492Z","order":1,"topic":{"id":"cjxr8jbl9000j1hyl2ci1lmj8","title":"Tuples"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8jbl9000j1hyl2ci1lmj8"],"title":"Tuples","content":[{"order":1,"type":"text","statement":"A tuple is a collection that is ordered and unchangeable.\nTuples are written with the round () brackets.\nSince a tuple is indexed, tuples can have items with the same value.\nTuples can also be iterated over using loops.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"tuple_name = (values)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"tuple1 = (\"abc\", 34, True, 40, \"male\")\n\nprint(tuple1)","terminalOutput":"('abc', 34, True, 40, 'male')"}],"id":"cko4istgz000p0v1q4lg17eiz","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T23:52:58.661Z","order":1,"topic":{"id":"cjxr81o1c00051hyl91rqe6iz","title":"Find & Replace functions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81o1c00051hyl91rqe6iz"],"title":"find() function","content":[{"order":1,"type":"text","statement":"find() function returns the index of the searched character in a string. \n\nIn the case of a substring that is a part of the string, find() returns the index of the first character of a searched substring in a string.\n\nIt returns -1 if the substring or character searched for is not present in the given string. \n\nIn the case of more than one occurrence of the substring, it returns the index of the first occurrence.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"string.find()","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"string = 'starry sky'\nprint(string.find('a'))\n\nline = 'Kate on her skateboard!'\nprint(line.find('Kate'))","terminalOutput":"2\n0"},{"order":4,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"line = 'Kate on her skateboard!'\nprint(line.find('Katie'))","terminalOutput":"-1"},{"order":5,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"line = 'Kate on her skateboard!'\nprint(line.find('ate'))\n#there are 2 \"\"ate\"\" substrings in variable line, but python shows the starting index of the first occurence.","terminalOutput":"1"}],"id":"cko321k7i004o0vz17v71bjty","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T23:52:58.662Z","order":2,"topic":{"id":"cjxr81o1c00051hyl91rqe6iz","title":"Find & Replace functions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr81o1c00051hyl91rqe6iz"],"title":"replace() function","content":[{"order":1,"type":"text","statement":"replace() function replaces a specified character or substring with another in a string.\nWe can also specify the number of times the character or substring needs to be replaced.\nIf count is not specified python replaces all the occurrences","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"string.replace('oldWord','newWord',count)\n\n#oldWord is a word you want to replace\n#newWord is a word you want to replace with\n#count is the number of times you want to replace oldWord with newWord","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"line = \"O’really? bababa!\"\nprint(line.replace('ba', 'ha'))\n\nline = \"O’really? bababa!\"\nprint(line.replace('ba', 'ha', 2))","terminalOutput":"O’really? hahaha!\nO’really? hahaba!"},{"order":5,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"#We can also replace two words in one go\nline = 'I saw Dave on his bicycle.'\nprint(line.replace('Dave', 'Donna').replace('his', 'her'))","terminalOutput":"I saw Donna on her bicycle."}],"id":"cko34719a004x0vz1f9df1qqf","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T20:41:22.986Z","order":1,"topic":{"id":"cjx2uyu3u000k1h2jfwexw830","title":"Conditions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx2uyu3u000k1h2jfwexw830"],"title":"Comparison Operators","content":[{"order":1,"type":"text","statement":"Equal to(==)\n\nCompares two variables and returns the boolean value True if they are equal and returns False if they aren't.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"Variable1==Variable2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":13,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(2==2.0)\nprint(3==5)","terminalOutput":"True\nFalse"},{"order":14,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(3!=5)\nprint(2!=2)","terminalOutput":"True\nFalse"},{"order":15,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(1>3)\nprint(10>8)","terminalOutput":"False\nTrue"},{"order":16,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(10<12)\nprint(10<9)","terminalOutput":"True\nFalse"},{"order":17,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(16>=16)\nprint(14>=15)","terminalOutput":"True\nFalse"},{"order":18,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(16<=18)\nprint(15<=10)","terminalOutput":"True\nFalse"},{"order":3,"type":"text","statement":"Not equal to operator (!=)\n\nCompares two variables and returns the boolean value True if they are NOT equal and returns False if they are.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"text","statement":"Greater than (>)\n\nReturns True if the first variable is greater than the second variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":7,"type":"text","statement":"Less than (<)\nReturns True if the first variable is less than the second variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":9,"type":"text","statement":"Greater than or equal to(>=)\nReturns True if the first variable is greater than or equal to the second variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":11,"type":"text","statement":"Less than or equal to(<=)\n\nReturns True if the first variable is less than or equal to the second variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"syntax","statement":null,"syntax":"Variable1!=Variable2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":6,"type":"syntax","statement":null,"syntax":"Variable1>Variable2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":8,"type":"syntax","statement":null,"syntax":"Variable1=Variable2","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":12,"type":"text","statement":"Variable1<=Variable2","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko37f0p600070vyngad074mz","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T20:41:22.986Z","order":2,"topic":{"id":"cjx2uyu3u000k1h2jfwexw830","title":"Conditions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx2uyu3u000k1h2jfwexw830"],"title":"Logical Operators","content":[{"order":1,"type":"text","statement":"and\n\nCompares two statements and returns True only if BOTH the statements are true, else it returns False.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"and\nStatement1 and Statement2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":7,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(3<7 and 8==8)\nprint(6>2 and 9==8)\n\nprint(4+5>8 or 9!=7)\nprint(6>7 or 8==9.0)\n\nprint(2>3 or 3==3 and 1>0)\n#both 3==3 and 1>0 are TRUE, so it becomes print(2>3 or TRUE), which becomes print(FALSE or TRUE), which prints TRUE","terminalOutput":"True\nFalse\nTrue\nFalse\nTrue"},{"order":3,"type":"text","statement":"or\n\nCompares two statements and returns True if any one of the statements is true","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"syntax","statement":null,"syntax":"or\nStatement1 or Statement2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":6,"type":"syntax","statement":null,"syntax":"Statement1 or Statement2 and Statement3\n#First we solve the AND operator, and then the OR","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"text","statement":"Multiple and / or\n\nIn multiple AND/OR conditional statements, AND has precedence over the OR.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko383jlo000g0vyn76j72cu4","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T20:16:56.460Z","order":1,"topic":{"id":"cjxr84rsc000c1hyl5rojdnha","title":"Nested loop"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr84rsc000c1hyl5rojdnha"],"title":"Nested Loops","content":[{"order":1,"type":"text","statement":"A nested loop is a loop inside another loop.\n\nThe \"inner loop\" will be executed for each iteration of the \"outer loop\".\n\nIf the outer loop runs for 5 times, and the inner loop runs for 10 times. Then for the 1st outer loop, the inner loop will run 10 times, for the 2nd outer loop, the inner loop will run 10 times, and so on.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"text","statement":"for inside for","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"syntax","statement":null,"syntax":"for iterating_var in sequence:\n for iterating_var in sequence:\n statements(s)\n statements(s)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"text","statement":"while inside for","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"syntax","statement":null,"syntax":"for iterating_var in sequence:\n while condition:\n statements\n statements","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":6,"type":"text","statement":"while inside while","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":7,"type":"syntax","statement":null,"syntax":"while condition:\n while condition:\n statement(s)\n statement(s)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":8,"type":"text","statement":"for inside while","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":9,"type":"syntax","statement":null,"syntax":"while condition:\n for iterating_var in sequence:\n statements\n statements","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":10,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"rows = 6\nfor num in range(rows):\n for i in range(num):\n print(num, end=\" \") # print number\n print(\" \")","terminalOutput":"1 \n2 2 \n3 3 3 \n4 4 4 4 \n5 5 5 5 5"}],"id":"cko3zbf1k003x0vynealkabht","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T20:11:54.512Z","order":1,"topic":{"id":"cjxr80vyp00031hyls4kux618","title":"Input & Embedding"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr80vyp00031hyls4kux618"],"title":"%s - String Formatting","content":[{"order":1,"type":"text","statement":"%s reserves a place for the variables that hold the value to be inserted in the string.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"print(\"String %s \" %variable_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"fruit = \"apples\"\nprint(\"Get me %s.\" %fruit)","terminalOutput":"Get me apples"}],"id":"cko2x3h90002k0vz116fp9rac","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T20:11:54.512Z","order":2,"topic":{"id":"cjxr80vyp00031hyls4kux618","title":"Input & Embedding"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr80vyp00031hyls4kux618"],"title":"f - String formatting","content":[{"order":1,"type":"text","statement":"f-strings are another way to use variables inside a print statement.\nYou can start the print command with an f, and wherever { variable } brackets are used, the value of the variable is inserted there.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"print(f\"string {variable_name}.\")","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"name = \"Zog\"\nage = 40\nprint(f\"Hello, {name}. You are {age}.\")","terminalOutput":"Hello, Zog. You are 40."}],"id":"cko2x478r002l0vz10t2o13g7","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T20:11:54.512Z","order":3,"topic":{"id":"cjxr80vyp00031hyls4kux618","title":"Input & Embedding"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr80vyp00031hyls4kux618"],"title":"Input Function","content":[{"order":1,"type":"text","statement":"The input() function allows the user to enter a value that gets stored in a variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"input(\"message to be shown in input prompt\")","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"x = input(\"Enter your name:\")\nprint(\"Hello, \" + x)","terminalOutput":"Enter your name: Zog\nHello Zog"}],"id":"cko2x4dpg002m0vz19ekphqca","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T20:07:52.308Z","order":1,"topic":{"id":"cjx2tbg7k00071h2jr4rxnjc0","title":"Intro to variables"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx2tbg7k00071h2jr4rxnjc0"],"title":"Initialising a variable","content":[{"order":1,"type":"text","statement":"Assigns a value to a variable.\nWe can also initialize multiple variables in the same line.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"variable_name = value","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"word = \"hello\"\nnumber = 5\nprint(word,number)\n\nword, number = \"hello\", 5\nprint(word,number)","terminalOutput":"hello 5\nhello 5"},{"order":3,"type":"syntax","statement":null,"syntax":"var1, var2 = value1, value2","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko14h04o000p0vxi9z5g4qlv","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T19:55:45.809Z","order":1,"topic":{"id":"cjxr7v4ud00001hyldvkg5dpg","title":"Naming a variable"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7v4ud00001hyldvkg5dpg"],"title":"Rules for initialising a variable","content":[{"order":1,"type":"text","statement":"Using Symbols\nOnly the underscore (_) symbol can be used while naming variables.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"text","statement":"Case sensitivity\nPython treats capital letters and small letters as different characters.\nPython variable names are case-sensitive (for eg. old, Old and OLD are three different variables)","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"text","statement":"Using numbers\nVariable names cannot begin with a number. Variable name must start with a letter or the underscore character.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"player_name=\"Theo\"\nprint(player_names)\nPlayer=\"Theo\"\nplayer=\"Zog\"\nprint(Player)\nprint(player)","terminalOutput":"Theo\nTheo\nZog"},{"order":5,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"2player=\"Zog\"","terminalOutput":"SyntaxError: invalid syntax"}],"id":"cko2ueafn001e0vz1hs7kh7tb","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T19:55:45.809Z","order":2,"topic":{"id":"cjxr7v4ud00001hyldvkg5dpg","title":"Naming a variable"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7v4ud00001hyldvkg5dpg"],"title":"Comments","content":[{"order":1,"type":"text","statement":"It is a good habit to write comments for your code.\nComments begin with a # symbol.\nComments help you structure your code in a better format and make it readable for others who would use your code.\n\nAfter all, there is a popular saying, \"Anyone can write code that a computer can understand. Good programmers write code that humans can understand.”","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"#insert comments here","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko2uqjf0001l0vz1h553az41","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T19:33:20.336Z","order":1,"topic":{"id":"cjxr850b7000d1hyldcqfp95t","title":"Break & Continue"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr850b7000d1hyldcqfp95t"],"title":"break","content":[{"order":1,"type":"text","statement":"break keyword is used to break out / get out of the immediate loop and execute the next statement.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"while expression:\n if condition:\n break\n #breaks out of the loop\n#executes statement outside the loop","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"word = input('Enter a word: ')\nfor letter in word:\n if letter in 'aeiou':\n print('Vowel found!')\n break","terminalOutput":"Vowel found!"}],"id":"cko3zlo2n004b0vyn3v9vhhi8","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T19:33:20.337Z","order":2,"topic":{"id":"cjxr850b7000d1hyldcqfp95t","title":"Break & Continue"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr850b7000d1hyldcqfp95t"],"title":"continue","content":[{"order":1,"type":"text","statement":"Python skips the statements after the continue keyword in the current iteration/cycle of the loop. \nThe loop does not stop.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"while expression:\n if condition:\n continue:\n #skips next statements and goes back to check the condition and starts from line 1 again","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"for num in range(1,11):\n if num == 4 or num== 6 or num==8: #When num = 5, it's False\n continue\n print(num)","terminalOutput":"1\n2\n3\n5\n7\n9\n10"}],"id":"cko3zlyp4004c0vynd0774c9c","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T17:40:51.038Z","order":1,"topic":{"id":"cjxr7yk5p00021hylg7ly9jya","title":"Intro to strings"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7yk5p00021hylg7ly9jya"],"title":"String Quotations","content":[{"order":1,"type":"text","statement":"Singleline strings\n' ' or \" \"\n\nMultiline strings (3 single quotes to open and close)\n'''\nsentences\n'''","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"var1 = \"value1\"\nvar2 = 'value2'\n\nvar3 = '''\nvalue3\n'''","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"var1 = \"Strings in Python\"\nvar2 = 'Strings in python'\nvar3 = '''\nMultiline\nstring in\nPython'''\nprint(var1)\nprint(var2)\nprint(var3)","terminalOutput":"Strings in Python\nStrings in python\nMultiline\nstring in\nPython"}],"id":"cko2vvj44001z0vz1b1kxh1dj","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:40:51.039Z","order":2,"topic":{"id":"cjxr7yk5p00021hylg7ly9jya","title":"Intro to strings"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7yk5p00021hylg7ly9jya"],"title":"Escaping (\\)","content":[{"order":1,"type":"text","statement":"To insert characters that are not allowed and raise an error in a string, we use an escape character.\nAn escape character is a backslash \\ followed by the character that is to be inserted. Python ignores the character after it.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(\"Best programming language is \"Python\".\")","terminalOutput":"SyntaxError: invalid syntax"},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(\"Best programming language is \\\"Python\\\".\")","terminalOutput":"Best programming language is \"Python\"."}],"id":"cko2w3hwt00230vz1hpatfnz0","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:40:51.039Z","order":3,"topic":{"id":"cjxr7yk5p00021hylg7ly9jya","title":"Intro to strings"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7yk5p00021hylg7ly9jya"],"title":"New line (\\n)","content":[{"order":1,"type":"text","statement":"To break the string to a new line, we use \\n before the character from where we want to break the string.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(\"Hello\\nWorld\")","terminalOutput":"Hello\nWorld"}],"id":"cko2w9jd700270vz1cqld99x8","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:40:51.039Z","order":4,"topic":{"id":"cjxr7yk5p00021hylg7ly9jya","title":"Intro to strings"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7yk5p00021hylg7ly9jya"],"title":"Tab space (\\t)","content":[{"order":1,"type":"text","statement":"To give 4 spaces or a tab after a word, we use \\t.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"print(\"Hello Hi \\t World\")","terminalOutput":"Hello Hi World"}],"id":"cko2wbylf002a0vz1gshu2voa","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:40:51.039Z","order":5,"topic":{"id":"cjxr7yk5p00021hylg7ly9jya","title":"Intro to strings"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7yk5p00021hylg7ly9jya"],"title":"Concatenation","content":[{"order":1,"type":"text","statement":"Joins two or more strings together.\nThe + operator is used to concatenate 2 or more strings.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"a = \"Hello\"\nb = \"World\"\nc = a + b\nprint(c)","terminalOutput":"HelloWorld"}],"id":"cko2wippg002e0vz149806cqh","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:40:51.040Z","order":6,"topic":{"id":"cjxr7yk5p00021hylg7ly9jya","title":"Intro to strings"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7yk5p00021hylg7ly9jya"],"title":"String Repetition","content":[{"order":1,"type":"text","statement":"The repetition operator is denoted by a '*' symbol and is used to repeat strings.\nYou can multiply a string with an integer, and it will be repeated that many times.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"str = \"Python\"\nprint(str*3)","terminalOutput":"PythonPythonPython"}],"id":"cko2wpj3v002h0vz1eia5564u","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T17:15:49.940Z","order":1,"topic":{"id":"cjx71ikma00081hx66rlxsmcn","title":"Assignment Statement"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx71ikma00081hx66rlxsmcn"],"title":"Assignment operator","content":[{"order":1,"type":"text","statement":"The '=' operator is known as assignment operator, also read as 'is set to'.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko16mo7o000v0vxi6ntf9w0t","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:15:49.940Z","order":2,"topic":{"id":"cjx71ikma00081hx66rlxsmcn","title":"Assignment Statement"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx71ikma00081hx66rlxsmcn"],"title":"Assignment statement","content":[{"order":1,"type":"text","statement":"A line of the program that assigns a value to a variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"variable = value\n# the value is stored in the variable","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"count = 5\nprint(count)","terminalOutput":"5"}],"id":"cko16ncvz000w0vxi0ufu1q8b","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:15:49.940Z","order":3,"topic":{"id":"cjx71ikma00081hx66rlxsmcn","title":"Assignment Statement"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx71ikma00081hx66rlxsmcn"],"title":"Math vs Python \"=\"","content":[{"order":1,"type":"text","statement":"In mathematics, = means to equate the left side with the right side.\nIn python, = symbol is used to set the value of the left side variable to the right side variable.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"variable = value\n# the value is stored in the variable\nvariable = variable + value\n# value is added to existing variable value and stored in the variable","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"count = 5\ncount = count + 2\n# new value of count is set to old value of count + 2\nprint(count)","terminalOutput":"7"}],"id":"cko16nl6f000x0vxid0x69pdg","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T17:04:59.452Z","order":1,"topic":{"id":"cjxr85tdk000g1hyl65ottzbi","title":"Nested List"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85tdk000g1hyl65ottzbi"],"title":"Nested lists","content":[{"order":1,"type":"text","statement":"Lists can be included within the main big list as an element of the main list.\n\nThese inner lists are called \"sub-lists\".","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_name=[item1,[item21,item22,item23],item3,item4]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"num_list = [1, 2, [3, 4]]\nprint(num_list)","terminalOutput":"1, 2, [3, 4]]"}],"id":"cko4fuiwf002k0vx4561o8v1r","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:04:59.452Z","order":2,"topic":{"id":"cjxr85tdk000g1hyl65ottzbi","title":"Nested List"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85tdk000g1hyl65ottzbi"],"title":"Indexing in Nested List","content":[{"order":1,"type":"text","statement":"If we want an item within the nested list or sublist of the list, we add the index of the item in the sublist (containing the item) along with the nested list/sublist index number.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list_name[index of sublist containing the item][index of the item in that sublist]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"num_list = [1, 2, [3, 4]]\nprint(num_list[2][0])\n\nlist_num = [1, 2, [3, [4, 5]]]\nprint(list_num[2][1][1])","terminalOutput":"3\n5"}],"id":"cko4fv8fx002l0vx447j47rgu","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T17:04:59.452Z","order":3,"topic":{"id":"cjxr85tdk000g1hyl65ottzbi","title":"Nested List"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr85tdk000g1hyl65ottzbi"],"title":"Adding, Replacing or Deleting values by slicing","content":[{"order":1,"type":"text","statement":"Nested lists can be added or changed within a list by slicing with the given indices.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":7,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"a = [1, 2, 5, 6]\na[2:2] = [[3, 4]]\n#The list [3,4] gets added between the 2nd and 3rd element\nprint(a)\n\na = [1, 2, 5, 6]\na[2] = [3, 4]\nprint(a)\n\na = [1, 2, 3, 4, 5]\na[1:3] = ['a','b']\nprint(a)\n\na = [1, 2, 3, 4, 5]\na[1:3] = ['a']\nprint(a)\n\na = [1, 2, 3, 4, 5]\na[1:3] = []\nprint(a)","terminalOutput":"[1, 2, [3, 4], 5, 6]\n[1, 2, [3,4], 6]\n[1, 'a', 'b', 4, 5]\n[1, 'a', 4, 5]\n[1, 4, 5]"},{"order":2,"type":"syntax","statement":null,"syntax":"#Adding an element to the list using slicing\nlist_name[starting_index:starting_index]=[value]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":4,"type":"syntax","statement":null,"syntax":"list_name[starting_index:ending_index]=[[value1,value2,...]]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"text","statement":"We can replace more than one element in one go.\n\nWe can also replace 2 or more elements with a lesser number of elements.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":5,"type":"text","statement":"Elements can also be removed from a list with the help of slicing.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":6,"type":"syntax","statement":null,"syntax":"list_name[starting_index:ending_index]=[]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko4fvjwr002m0vx4aib26tep","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T16:54:43.698Z","order":1,"topic":{"id":"cjxr7xtr600011hylnzfxh3sw","title":"Operators"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7xtr600011hylnzfxh3sw"],"title":"Operators","content":[{"order":1,"type":"text","statement":"Python Arithmetic Operators\nAddition (+)\nSubstraction (-)\nMultiplication (*)\nDivision (/)\nFloor Division (//) - Returns the quotient of the division\nModulus (%) - Returns the remainder of the division\nExponentiation (**) - Power raised to","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"a,b=10,3\nprint('Add:',a+b,'Subtract:',a-b,'Multiply:',a*b,'Divide:',a/b)\nprint('Floor Division:',a//b) #floor division\n#division always prints float value\nprint(\"Modulus:\",a%b) #modulus #remainder when 10 is divided by 3\nprint(\"Exponentition:\",a**b) #10 to the power 2","terminalOutput":"Add: 13 Subtract: 7 Multiply: 30 Divide: 3.3333333333333335\nFloor Division: 3\nModulus: 1\nExponentition: 1000"}],"id":"cko2uubq4001o0vz13zmmhspi","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T16:54:43.698Z","order":2,"topic":{"id":"cjxr7xtr600011hylnzfxh3sw","title":"Operators"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr7xtr600011hylnzfxh3sw"],"title":"BEMDAS Rule - Solving equations with multiple operators","content":[{"order":1,"type":"text","statement":"Whenever there is an expression in python, python solves it in the following order. \n\n1. Brackets (B)\n2. Exponents (E)\n3. Multiplication (M)\n4. Division (D)\n5. Addition (A)\n6. Subtraction (S)\n\nWhenever multiple exponent operators are used in an expression, python solves it from right to left.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"image","statement":null,"syntax":null,"image":{"id":"cko2vnwb5001y0vz1090kawij","uri":"python/cheatsheetcontent/image_cko2vmkdf001x0vz1azrx9ajn_1619700173340.gif"},"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko2v4sya001q0vz1dc0v5y5j","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T16:45:23.555Z","order":1,"topic":{"id":"cjxr8oi1j000u1hyllatozhur","title":"Function Return"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8oi1j000u1hyllatozhur"],"title":"Return Statement","content":[{"order":1,"type":"text","statement":"When we call a function, we can get a value from it as an output using the return statement. We can store this value in a variable and use it outside the function.\n\nMost in-built functions return a value when we use them, like len(), min(), max(), etc.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"def function_name():\n \n return variable_name\nvalue = function_name()","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"def add(num1, num2):\n total = num1 + num2\n return total\nanswer = add(1,2)\nprint(answer)","terminalOutput":"3"}],"id":"cko5ic08k006d0v1q6zujdbol","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T06:08:50.381Z","order":1,"topic":{"id":"cjxr8kv2y000p1hylz4mmz213","title":"Dictionary Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8kv2y000p1hylz4mmz213"],"title":"Keys and Values","content":[{"order":1,"type":"text","statement":"keys()\nThe dictionary method keys() can be used to print all the keys of a dictionary.\n \nvalues()\nSimilarly, the method values() can be used to print all the values of a dictionary.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name.keys()\ndict_name.values()","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_1 = { 'a' : 1, 'b' : 2 }\nprint(dict_1.keys())\nprint(dict_1.values())","terminalOutput":"dict_keys(['a','b'])\ndict_values([1,2])"}],"id":"cko4p0x5b002k0v1q5ibi7b3m","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:08:50.381Z","order":2,"topic":{"id":"cjxr8kv2y000p1hylz4mmz213","title":"Dictionary Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8kv2y000p1hylz4mmz213"],"title":"dict() Function","content":[{"order":1,"type":"text","statement":"The dict() method is used to create a dictionary. \nWe pass a list of tuples as arguments inside the function, each tuple has two elements that are taken as key-value pairs. \n\nIf no arguments are given inside the bracket, an empty dictionary is created.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name = dict()\n#empty dictionary\ndict_name = dict( [(key_1, value_1), (key_2,value_2)])\n#dictionary with key-value pairs","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_empty = dict()\ndict_new = dict( [(1,'a'), (2,'b')] )\nprint(dict_empty)\nprint(dict_new)","terminalOutput":"{ }\n{ 1 : 'a', 2 : 'b' }"}],"id":"cko4p37a0002o0v1q5mlfc928","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:08:50.381Z","order":3,"topic":{"id":"cjxr8kv2y000p1hylz4mmz213","title":"Dictionary Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8kv2y000p1hylz4mmz213"],"title":"update() Method","content":[{"order":1,"type":"text","statement":"The update() method is used to change the value of an existing key, or add a new key-value pair to the dictionary.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name.update({ key : value })","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_1 = { 'a' : 1, 'b' : 2 }\ndict_1.update({'b' : 3, 'c' : 4})\nprint(dict_1)","terminalOutput":"{ 'a' : 1, 'b' : 3, 'c' : 4 }"}],"id":"cko4p5oys002s0v1q2towh13l","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:08:50.381Z","order":4,"topic":{"id":"cjxr8kv2y000p1hylz4mmz213","title":"Dictionary Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8kv2y000p1hylz4mmz213"],"title":"pop() Method","content":[{"order":1,"type":"text","statement":"The pop() method is used to remove a key-value pair from a dictionary. \n\nWe can store the value of this pair and use it in a variable as well.\n\nA default value can be given, in case the key you are trying to remove does not exist in the dictionary.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name.pop(key, default_value)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_1 = { 'a' : 1, 'b' : 2 }\ndeleted_value = dict_1.pop('a')\ndefault_value = dict_1.pop('z', -5)\nprint(deleted_value)\nprint(default_value)\nprint(dict_1)","terminalOutput":"1\n-5\n{ 'b' : 2 }"}],"id":"cko4p794x002w0v1q6xe5b9nk","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:08:50.381Z","order":5,"topic":{"id":"cjxr8kv2y000p1hylz4mmz213","title":"Dictionary Methods"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8kv2y000p1hylz4mmz213"],"title":"get() Function","content":[{"order":1,"type":"text","statement":"The get() method is used to access the value using the key. It is helpful because in case the key doesn't exist, a default value can be used.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name.get(key, default_value)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_1 = { 'a' : 4, 'b' : 8 }\nvalue = dict_1.get('a')\ndefault_value = dict_1.get('z', -5)\nprint(value)\nprint(default_value)\nprint(dict_1)","terminalOutput":"4\n-5\n{ 'a' : 4, 'b' : 8 }"}],"id":"cko4p9r4q00300v1q2ccshbqw","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T06:04:20.035Z","order":1,"topic":{"id":"cjxr8nv17000r1hyllt20n44u","title":"Functions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8nv17000r1hyllt20n44u"],"title":"Definition of Function","content":[{"order":1,"type":"text","statement":"Function\nFunctions are mini-programs or a block of code that are reusable anywhere in your program. \nA function performs a task, and once it is defined we can perform the task by calling the function using the function name.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5fp4w900550v1qekq3a3e1","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:04:20.036Z","order":2,"topic":{"id":"cjxr8nv17000r1hyllt20n44u","title":"Functions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8nv17000r1hyllt20n44u"],"title":"In-Built Functions","content":[{"order":1,"type":"text","statement":"Python has a set of in-built functions that are already defined to perform a certain task.\nThe python interpreter has several functions that are always present for use.\n\nEg. print(), min(), max(), len(), etc.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5fql9a00570v1q10qm52be","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:04:20.036Z","order":3,"topic":{"id":"cjxr8nv17000r1hyllt20n44u","title":"Functions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8nv17000r1hyllt20n44u"],"title":"User Defined Functions","content":[{"order":1,"type":"text","statement":"Python allows us to define and use our own custom logic inside a function.\nFunctions that we define ourselves to do certain specific tasks are referred to as user-defined functions.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko5fskms00590v1q4i28aybx","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:04:20.036Z","order":4,"topic":{"id":"cjxr8nv17000r1hyllt20n44u","title":"Functions"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8nv17000r1hyllt20n44u"],"title":"Calling a Function","content":[{"order":1,"type":"text","statement":"Calling (Using) a function is done in a particular way in Python.\nWe just write the name of the function followed by round () brackets containing the arguments.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"function_name(arguments)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"word = 'apple'\nprint(len(word))\n#Here len() function has the argument 'apple', and print() function has the argument as len()","terminalOutput":"5"}],"id":"cko5g53rv005l0v1q6xcf46kv","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-28T06:03:13.651Z","order":1,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Length of a List - len()","content":[{"order":1,"type":"text","statement":"len() function determines the number of elements in a list and returns the same.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"len(list_name)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = [1, 2, 3, 1, 2, 1, 2, 3, 2, 1] \nprint(len(List))","terminalOutput":"10"}],"id":"cko4gjvgz00350vx409d24bjf","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:03:13.651Z","order":2,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Append to a List - append()","content":[{"order":1,"type":"text","statement":"append() method adds an element to the end of the list.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list.append (element)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = ['Mathematics', 'chemistry', 1997, 2000] \nList.append(20544) \nprint(List)","terminalOutput":"['Mathematics', 'chemistry', 1997, 2000, 20544]"}],"id":"cko4gkhn8003b0vx45u5r5eyv","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:03:13.651Z","order":3,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Insert into a List - insert()","content":[{"order":1,"type":"text","statement":"insert() method helps us to insert an element at a specific index in a list.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list.insert(position_index, element)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = ['Mathematics', 'chemistry', 1997, 2000] \nList.insert(2,10087)\nprint(List)","terminalOutput":"['Mathematics', 'chemistry', 10087, 1997, 2000, 20544]"}],"id":"cko4gkq3w003c0vx4fstx3096","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:03:13.651Z","order":4,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Remove from a List - remove()","content":[{"order":1,"type":"text","statement":"The remove() method removes the specified item from a list.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"list.remove(element)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] \nList.remove(3) \nprint(List)","terminalOutput":"[2.3, 4.445, 5.33, 1.054, 2.5]"}],"id":"cko4gkx72003d0vx48q0y4pln","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:03:13.652Z","order":5,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Delete from a List - del","content":[{"order":1,"type":"text","statement":"The del keyword removes the specified index and can also delete the list completely.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"del list[index]","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] \ndel List[0] \nprint(List)","terminalOutput":"[4.445, 3, 5.33, 1.054, 2.5]"}],"id":"cko4gl5zm003e0vx448bu1uob","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:03:13.652Z","order":6,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Minimum item of a List - min()","content":[{"order":1,"type":"text","statement":"List method min() returns the elements from the list with minimum value.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"min(List)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] \nprint(min(List))","terminalOutput":"1.054"}],"id":"cko4glf99003f0vx46y402nop","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:03:13.652Z","order":7,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Maximum item of a List - max()","content":[{"order":1,"type":"text","statement":"List method max() returns the elements from the list with maximum value.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"max(List)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] \nprint(max(List))","terminalOutput":"5.33"}],"id":"cko4glqkt003g0vx42so9628s","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-28T06:03:13.652Z","order":8,"topic":{"id":"cjxr8ij5s000i1hyldqxb5uxj","title":"List operations"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj"],"title":"Sum of items in a List - sum()","content":[{"order":1,"type":"text","statement":"The sum() function returns the sum of all items in a list.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"sum(List)","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"List = [1, 2, 3, 4, 5] \nprint(sum(List))","terminalOutput":"15"}],"id":"cko4glyka003h0vx49v4g1vjz","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-27T03:03:06.432Z","order":1,"topic":{"id":"cjx37p3z000091hz54blwt4gy","title":"Elif"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjx37p3z000091hz54blwt4gy"],"title":"elif","content":[{"order":1,"type":"text","statement":"Elif\nElif lets you add more than one conditional statement to your if-else program.\n\nIn multiple elif conditions, Python checks for the next one if the previous ones are not True.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"if condition1:\n option1\nelif condition2:\n option2\nelif condition3:\n option3\n\n.......\nelse:\n option","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"if age >= 10 and height > 150:\n print('You get roller coaster!')\nelif age >= 10 and height <= 150:\n print('You get water rides!')\nelse:\n print('Sorry, no rides for you!')","terminalOutput":"You get roller coaster!"}],"id":"cko3stwdy00210vyn1vc1fcy5","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-27T03:02:54.382Z","order":1,"topic":{"id":"cjxr842lv00091hylcqh3ypip","title":"For loop"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr842lv00091hylcqh3ypip"],"title":"for loop","content":[{"order":1,"type":"text","statement":"The for loop iterates over a sequence (that is a list, tuple, dictionary, set, or a string)\n\nWe use a variable to create the for loop, which is called the Loop variable. \n\nThere are two ways to create the For loop. One is with the range() method, and the other is without using the range() method.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null}],"id":"cko3yi2gt003e0vyn5hmy5ajq","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-27T03:02:54.382Z","order":2,"topic":{"id":"cjxr842lv00091hylcqh3ypip","title":"For loop"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr842lv00091hylcqh3ypip"],"title":"for loop with range()","content":[{"order":1,"type":"text","statement":"Using the range() method, you can specify a starting number and an ending number. \n\nThe loop will run those many times, and in each cycle, the loop variable will hold those numbers.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"for loop_variable in range(start, end):\n \n#the loop runs from start to end-1","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"for num in range(0, 5):\n print(num)","terminalOutput":"0\n1\n2\n3\n4"}],"id":"cko3yp9zu003i0vyn2ga495qh","isBookmarked":false},{"isSelected":false,"fetchedAt":"2024-03-27T03:02:54.382Z","order":3,"topic":{"id":"cjxr842lv00091hylcqh3ypip","title":"For loop"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr842lv00091hylcqh3ypip"],"title":"for loop without range()","content":[{"order":1,"type":"text","statement":"Without the range method, a for loop can iterate over letters in a string, elements in a list, tuple, or a dictionary as well.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"for loop_variable in string_variable:\n ","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"word = 'bumfuzzle'\nfor letter in word: #In loop 1, letter = 'b'\n print(letter)","terminalOutput":"b\nu\nm\nf\nu\nz\nz\nl\ne"}],"id":"cko3ypjmz003j0vynent04coh","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-27T03:01:54.517Z","order":1,"topic":{"id":"cjxr8o1zr000s1hyl2yuoxo0n","title":"Function Structure"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8o1zr000s1hyl2yuoxo0n"],"title":"Defining a Function","content":[{"order":1,"type":"text","statement":"def keyword is used to create a function in python.\nWe define a function by writing def followed by the function name, the round () brackets, and colon \":\".\nThe function body then functions body comes under the def block. It needs to be indented(4 spaces or a tab).","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"def function_name():\n ","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"def add():\n a=1\n b=2\n print(a+b)\nadd()\n#calling the function","terminalOutput":"3"}],"id":"cko5g787m005p0v1qbzlf40yf","isBookmarked":false},{"isSelected":true,"fetchedAt":"2024-03-23T06:34:12.787Z","order":1,"topic":{"id":"cjxr8k6w9000m1hylfim3d0m3","title":"Dictionary I"},"userCheatSheetId":"","status":"unpublished","__keys":["cheatSheetConcepts/cjxr8k6w9000m1hylfim3d0m3"],"title":"Dictionary","content":[{"order":1,"type":"text","statement":"Dictionaries store the data values in the key-value pairs.\nCurly {} brackets are used to define a Dictionary. \nThe Key-Value pairs inside the dictionaries are separated by a colon ':'. \nThe left side is called the key, and the right side is the value.\nYou can access the values with the help of the keys as there is no indexing in Dictionaries.","syntax":null,"image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":2,"type":"syntax","statement":null,"syntax":"dict_name = { key : value }","image":null,"emoji":[],"terminalInput":null,"terminalOutput":null},{"order":3,"type":"terminal","statement":null,"syntax":null,"image":null,"emoji":[],"terminalInput":"dict_1 = { 'Theo' : 7717234567, 'Zo' : 8211132111 }\nprint(dict_1['Zo'])\n#accessing the key 'Zo', to get the value","terminalOutput":"8211132111"}],"id":"cko4lw8rz001q0v1q9a3l2k6w","isBookmarked":false}],"fetchStatus":{"cheatSheetConcepts/cjxr8pu4p000z1hylrt0zpw82":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/favourites":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8pk69000y1hylefpn68tg":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr84rsc000c1hyl5rojdnha":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8oszh000v1hylgc2kj1mu":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr81adf00041hyl0jv7d8ph":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8nv17000r1hyllt20n44u":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx2uyu3u000k1h2jfwexw830":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr84jzu000b1hylqb8iisds":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8pag8000x1hylbmhg0dzq":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr850b7000d1hyldcqfp95t":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr7v4ud00001hyldvkg5dpg":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8ij5s000i1hyldqxb5uxj":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx37okxu00081hz5nfl4sdyb":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8knn4000o1hylzl5qtjxm":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8o90l000t1hyltmu6vro1":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx2x6ie9000g1h28el7brjfn":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx722egv000h1hx65t1lawzt":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr7yk5p00021hylg7ly9jya":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8k6w9000m1hylfim3d0m3":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8kegv000n1hyla36xi883":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8kv2y000p1hylz4mmz213":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8jbl9000j1hyl2ci1lmj8":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr842lv00091hylcqh3ypip":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx2czgja00001h2xt7fjlh04":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx71ikma00081hx66rlxsmcn":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr85ijr000f1hylxqfv47k8":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8d75v000h1hyl0cvj3xvi":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8p0al000w1hylucda5ht0":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr83v7x00081hylz9nmmjio":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr7xtr600011hylnzfxh3sw":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr81o1c00051hyl91rqe6iz":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr85tdk000g1hyl65ottzbi":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/undefined":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8jy9n000l1hyl9k8ugz6c":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr80vyp00031hyls4kux618":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8jnzo000k1hylx17j5vh9":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx2tbg7k00071h2jr4rxnjc0":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8o1zr000s1hyl2yuoxo0n":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjx37p3z000091hz54blwt4gy":{"loading":false,"failure":false,"success":true,"stale":false},"cheatSheetConcepts/cjxr8oi1j000u1hyllatozhur":{"loading":false,"failure":false,"success":true,"stale":false}},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"mentorMenteeSession":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userAssignment":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"homeworkReviewTopicDetail":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"currentTopicComponentDetail":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"menteeSession":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userBadge":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"notice":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"videos":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"fetchQuizQuestionsIndividualPq":{"data":null,"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"courses":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"getClassroomReportForBlockBasedPractice":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"markSessionAsIncomplete":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"events":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"eventWinners":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"previousSessionTopicData":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"codingQuestionData":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userHomeworkStreaks":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"course":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"salesOperation":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"mentorChild":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"noticeAttachment":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userAssignments":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"guestMode":{"data":{"isGuestMode":true}},"learningObjective":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"batchSession":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"updateVisitorReactionOnUserApprovedCode":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"learnVideos":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"approvedCodeReactionLogs":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userTopicJourney":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"updateSchool":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"eventCertificate":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"menteeCourseSyllabus":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userProfile":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"fetchQuizQuestionsPq":{"data":null,"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"teacherAppClassrooms":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"courseTopics":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"dumpBlockBasedProject":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"currentClassroomMeta":{"data":{},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"unlockBadge":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"previousEventDetails":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"schoolMentorProfiles":{"data":[],"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}},"userApprovedCodeTagMappingsCount":{"data":{"groupByData":[{"groupByFieldValue":"tkinter","count":1},{"groupByFieldValue":"games","count":18},{"groupByFieldValue":"random","count":5},{"groupByFieldValue":"for loop","count":17},{"groupByFieldValue":"mathematics","count":18},{"groupByFieldValue":"dictionary","count":4},{"groupByFieldValue":"function","count":24},{"groupByFieldValue":"elif","count":25},{"groupByFieldValue":"data structure","count":1},{"groupByFieldValue":"class","count":3},{"groupByFieldValue":"nested dictionary","count":1},{"groupByFieldValue":"if-else","count":35},{"groupByFieldValue":"list","count":2},{"groupByFieldValue":"webbrowser","count":2},{"groupByFieldValue":"while loop","count":21},{"groupByFieldValue":"utilities","count":24},{"groupByFieldValue":"loop","count":7}]},"fetchStatus":{},"mergeStatus":{},"addStatus":{},"updateStatus":{},"deleteStatus":{}}}}Tekie - Online Coding Courses for Kids | World's 1st Education Series on Coding

Scope

The 
scope
 
of 
a 
variable 
means 
the 
block 
of 
the 
program 
where 
you 
can 
use 
that 
variable.
The 
variable 
is 
only 
available 
from 
inside 
the 
region
 
it 
is 
created, 
this 
is 
called 
the 
scope 
of 
the 
variable.

Global Variable

You 
can 
use 
a 
global 
variable
 
anywhere 
inside 
your 
program, 
even 
inside 
functions.
var_name
def function_name():
    print(var_name)
num1 = 1
num2 = 2
def add():
    print(num1+num2)
add()

Local Variable

The 
scope 
of 
a 
local
 
variable
 
is 
limited 
only 
to 
that 
particular 
block. 
For
 
example
, 
a 
variable 
declared 
in 
a 
function 
can 
only 
be 
used 
in 
that 
particular 
function. 
A 
function 
cannot
 
use 
the 
local 
variables 
from 
other 
functions.