While | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

While

i = 1 while i <=5: print(i) i = i + 1 what does i=i + 1? Does it add 1 then 1 turns 2 then adds 1 again turns to 3 does it loop like that? Answer me Senpai

15th Mar 2017, 2:24 AM
Randle Valerio
6 Antworten
+ 3
i=i+1 will add an increments to initial value of i( that is 1) everytime the while loop execute until i become 6. I have a suggestion to you, try to learn the basics yourself before asking questions.
15th Mar 2017, 3:56 AM
Nithin
Nithin - avatar
+ 1
It means adding 1 to its value each time
15th Mar 2017, 4:20 AM
Gloria E. Hanna
Gloria E. Hanna - avatar
0
Randle should know what i=i+1 means
15th Mar 2017, 2:28 AM
Andrew Smith
0
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #ifndef __CEPH_OSD_CHAIN_XATTR_H #define __CEPH_OSD_CHAIN_XATTR_H #include "common/xattr.h" #include <errno.h> #define CHAIN_XATTR_MAX_NAME_LEN 128 #define CHAIN_XATTR_MAX_BLOCK_LEN 2048 // wrappers to hide annoying errno handling. static inline int sys_fgetxattr(int fd, const char *name, void *val, size_t size) { int r = ::ceph_os_fgetxattr(fd, name, val, size); return (r < 0 ? -errno : r); } static inline int sys_getxattr(const char *fn, const char *name, void *val, size_t size) { int r = ::ceph_os_getxattr(fn, name, val, size); return (r < 0 ? -errno : r); } static inline int sys_setxattr(const char *fn, const char *name, const void *val, size_t size) { int r = ::ceph_os_setxattr(fn, name, val, size); return (r < 0 ? -errno : r); } static inline int sys_fsetxattr(int fd, const char *name, const void *val, size_t size) { int r = ::ceph_os_fsetxattr(fd, name, val, size); return (r < 0 ? -errno : r); } static inline int sys_listxattr(const char *fn, char *names, size_t len) { int r = ::ceph_os_listxattr(fn, names, len); return (r < 0 ? -errno : r); } static inline int sys_flistxattr(int fd, char *names, size_t len) { int r = ::ceph_os_flistxattr(fd, names, len); return (r < 0 ? -errno : r); } static inline int sys_removexattr(const char *fn, const char *name) { int r = ::ceph_os_removexattr(fn, name); return (r < 0 ? -errno : r); } static inline int sys_fremovexattr(int fd, const char *name) { int r = ::ceph_os_fremovexattr(fd, name); return (r < 0 ? -errno : r); } // wrappers to chain large values across multiple xattrs int chain_getxattr(const char *fn, const char *name, void *val, size_t size); int chain_fgetxattr(int fd, const char *name, void *val, size_t size); int chain_setxattr(const char *fn, const char *name, const void *val, size_t size); int chain_fsetxattr(int fd, const Randle is still trash!
15th Mar 2017, 2:30 AM
Andrew Smith
- 1
Randle is trash
15th Mar 2017, 2:25 AM
Andrew Smith
- 2
Smith is Trash
15th Mar 2017, 2:28 AM
Randle Valerio